s = []
from collections import defaultdict
d = defaultdict(int)
seen = set()
ss=[]
def dfs(i, j, s, res):
    global ss
    seen.add((i, j))
    ss.append((i,j))
    put = [(1, 0), (0, 1), (1, 1), (0, -1), (-1, 0), (-1, -1), (-1, 1), (1, -1)]
    for x, y in put:
        xx = i + x
        yy = y + j
        if 0 <= xx < 10 and 0 <= yy < 10 and (xx, yy) not in seen and s[xx][yy] == '#':
            dfs(xx, yy, s, res)
    d[len(ss)]+=1

    ss=[]
for j in range(10):
    s.append(input())

for i in range(10):
    for j in range(10):
        if s[i][j] == '#' and (i, j) not in seen:
            res = 0
            dfs(i, j, s, res)

if(d[1]==4 and d[2]==3 and d[3]==2 and d[4]==1):
    print('YES')
else:
    print("NO")
