d = [['.' for _ in range(99)] for _ in range(99)]

def ver(x, j):
    ans = 0
    i = x
    while i < 11 and d[i][j] == '#':
        ans += 1
        d[i][j] = '.'
        i += 1
    return ans

def hor(i, y):
    ans = 0
    j = y
    while j < 11 and d[i][j] == '#':
        ans += 1
        d[i][j] = '.'
        j += 1
    return ans

for i in range(1, 11):
    row = input()
    for j in range(1, 11):
        d[i][j] = row[j - 1]

for i in range(1, 11):
    for j in range(1, 11):
        if d[i][j] == '#' and (d[i + 1][j + 1] == '#' or d[i + 1][j - 1] == '#' or (d[i][j + 1] == '#' and d[i + 1][j] == '#')):
            print("NO")
            exit(0)

for i in range(1, 11):
    for j in range(1, 11):
        if d[i][j] == '#':
            if d[i][j + 1] == '#':
                a[hor(i, j)] += 1
            else:
                a[ver(i, j)] += 1

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