mas=[]
four=0
three=0
two=0
one=0
def check(qi,qj,mas,bad_directions,boat_index):
    flag=0
    for i in range(len(bad_directions)):
        bi=qi+bad_directions[i][0]
        bj=qj+bad_directions[i][1]
        if bi!=-1 and bi!=10 and bj!=-1 and bj!=10:
            if mas[bi][bj]=='#' and [bi,bj] not in boat_index:
                flag=1
		break;
    return flag
        

bad_directions=((1,1),(-1,-1),(1,-1),(-1,1),(0,-1),(-1,0))
for i in range(10):
    a=input()
    mas.append(a)
boat_indexes=[]
flag=0
for i in range(10):
    if flag:
        break
    for j in range(10):
        if one>4 or two>3 or three>2 or four>1:
            flag=1
        if flag:
            break
        if mas[i][j]=='#' and [i,j] not in boat_indexes:
            len_count=1
            boat_index=[[i,j]]
            direc=0
            indi=i
            indj=j
            if i+1!=10 and mas[i+1][j]=='#':
                direc=(1,0)
            elif j+1!=10 and mas[i][j+1]=='#':
                direc=(0,1)
            if direc:
                while True:
                    qi=indi+direc[0]
                    qj=indj+direc[1]
                    if qi!=10 and qj!=10:
                        if mas[qi][qj]=='#':
                            len_count+=1
                            boat_index.append([qi,qj])
                            boat_indexes.append([qi,qj])
                        
                        elif mas[qi][qj]!='#':
                            break
                        flag=check(qi,qj,mas,bad_directions,boat_index)
                        if flag:
                            break
                        indi=qi
                        indj=qj
            if len_count==4:
                four+=1
            if len_count==3:
                three+=1
            if len_count==2:
                two+=1
            if len_count==1:
                one+=1
            if len_count>4:
                flag=1
if four!=1 or three!=2 or two!=3 or one!=4 or flag==1:
    print('NO')
else:
    print('YES')