a=[[e=='#' for e in input()] for i in range(10)]
s=set()
V=[]
for vx in range(-1,2):
    for vy in range(-1,2):
        if abs(vx)|abs(vy):
            V.append([vx,vy])
def f(x,y):
    s.add((x,y))
    for vx,vy in V:
        X=x+vx
        Y=y+vy
        if X>=0 and X<10 and Y>=0 and Y<10 and a[X][Y] and (X,Y) not in s:
            f(X,Y)
S=set()
c=[0]*5
def g():
    L=min(e[0] for e in s)
    R=max(e[0] for e in s)
    U=min(e[1] for e in s)
    D=max(e[1] for e in s)
    w=R-L+1
    h=D-U+1
    if min(w,h)!=1 or max(w,h)>4:
        c[0]+=1
        return
    for i in range(L,R+1):
        for j in range(U,D+1):
            if (i,j) not in s:
                c[0]+=1
                return
    c[max(w,h)]+=1
for i in range(10):
    for j in range(10):
        if a[i][j] and (i,j) not in S:
            f(i,j)
            g()
            S=S|s
            s=set()
print("YES" if c==[0,4,3,2,1] else "NO")
