a=[]
l=0
end=False
for i in range(10):
    n=list(input())
    a.append(n)
f,s,t,F=0,0,0,0
for i in range(10):
    for j in range(10):
        l=0
        if a[i][j]=="#":
            a[i][j]="."
            l+=1
            ii=i
            jj=j
            while jj+1<=9 and a[ii][jj+1]=="#":
                #print(ii,jj,">")
                if ii+1<=9 and a[ii+1][jj]=="#":
                    #print(a[ii+1][jj])
                    end=True
                if ii+1<=9 and jj+1<=9 and a[ii+1][jj+1]=="#":
                    #print(a[ii+1][jj+1])
                    end=True
                if jj+2<=9 and a[ii][jj+1]!="#" and a[ii][jj+2]=="#":
                    end=True
                    #print(a[ii][jj+2])
                if ii+1<=9 and jj+2<=9 and a[ii+1][jj+2]=="#":
                    #print(a[ii+1][jj+2])
                    end=True
                l+=1
                a[ii][jj+1]="."  
                #print(a[ii][jj+1])
                jj+=1
            jj=j
            while ii+1<=9 and a[ii+1][jj]=="#":
                #print(ii,jj,"{}")
                if jj+1<=9 and a[ii+1][jj+1]=="#":
                    end=True
                    #print(a[ii+1][jj+1]=="#")
                if jj+1<=9 and ii+1<=9 and a[ii+1][jj+1]=="#":
                    end=True
                    #print(a[ii+1][jj+1]=="#")
                if jj+2<=9 and a[ii][jj+2]=="#":
                    #print(a[ii+2][jj])
                    end=True
                if jj+2<=9 and ii+1<=9 and a[ii+1][jj+2]=="#":
                    #print(a[ii+2][jj+1])
                    end=True
                l+=1
                a[ii+1][jj]="."
                #print(a[ii+1][jj])
                ii+=1
        if l==1:
            f+=1
        elif l==2:
            s+=1
        elif l==3:
            t+=1
        elif l==4:
            F+=1
#print(f,s,t,F)
if end:
    print("NO")
elif f==4 and s==3 and t==2 and F==1:
    print("YES")
else:
    print("NO")
    
            
            
            
