
a = [list("." + input() + ".") for i in range(10)]
a.insert(0, list("." * 12))
a.append("." * 12)
b = [0] * 4

vectors = [(-1,0),(1,0),(0,1),(0,-1),(-1,-1),(-1,1),(1,1),(1,-1)]

count_ship = [4,3,2,1]
m = set()
for i in range(1, 11):
    for j in range(1, 11):
        if (i,j) not in m:
            if a[i][j] == '#':
                l = 1
                other_cell = False
                for vector in vectors:
                    if a[i+vector[0]][j+vector[1]] == '#':
                        if (vector[0] != 0) and (vector[1] != 0):
                            print('NO')
                            exit()
                        while a[i+vector[0]*l][j+vector[1]*l] == '#':
                            m.add((i+vector[0]*l,j+vector[1]*l))
                            l+=1
                
                        if other_cell:
                            print('NO')
                            exit()
                        other_cell = True
                count_ship[l-1] -= 1
if count_ship == [0,0,0,0]:
    print('YES')
else:
    print('NO')