# import sys
# import os
# import io
#
# input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
# output = sys.stdout.buffer.write
# def print(*values, sep=' ', end='\n'):
#     output(sep.join(str(value) for value in values).encode())
used = dict()
a = [list(input()) for _ in range(10)]
ships = {4: 1, 3: 2, 2: 3, 1: 4}
OK = True
in_row = 0
for i in range(10):
    for j in range(10):
        if j + 1 < 10 and i + 1 < 10:
            if a[i][j] == '#' and a[i + 1][j + 1] == '#':
                OK = False
        if i + 1 < 10 and j - 1 >= 0:
            if a[i][j] == '#' and a[i + 1][j - 1] == '#':
                OK = False
        if i - 1 >= 0 and j - 1 >= 0:
            if a[i][j] == '#' and a[i - 1][j - 1] == '#':
                OK = False
        if i - 1 >= 0 and j + 1 < 10:
            if a[i][j] == '#' and a[i - 1][j + 1] == '#':
                OK = False
        if i + 1 < 10 and j + 1 < 10 and a[i][j] == '#' and a[i + 1][j] == '#' and a[i][j + 1] == '#':
            OK = False
        if j - 1 >= 0 and i + 1 < 10 and a[i][j] == '#' and a[i][j - 1] == '#' and a[i + 1][j] == '#':
            OK = False
        if j - 1 >= 0 and i - 1 >= 0 and a[i][j] == '#' and a[i - 1][j] == '#' and a[i][j - 1] == '#':
            OK = False
        if j + 1 < 10  and i - 1 >= 0 and a[i][j] == '#' and a[i][j + 1] == '#' and a[i - 1][j] == '#':
            OK = False
        used[i][j] = False
if not OK:
    print('NO')
    exit(0)
for i in range(10):
    for j in range(10):
        is_1 = False
        if a[i][j] == '#':
            is_1 = True
        try:
            if a[i][j + 1] == '#':
                is_1 = False
        except:
            pass
        if j - 1 >= 0:
            if a[i][j - 1] == '#':
                is_1 = False
        try:
            if a[i + 1][j] == '#':
                is_1 = False
        except:
            pass
        if i - 1 >= 0:
            if a[i - 1][j] == '#':
                is_1 = False
        if is_1:
            a[i][j] = '.'
            ships[1] -= 1


for i in range(10):
    in_row = 0
    for j in range(10):
        if a[i][j] == '#':
            in_row += 1
        else:
            if in_row > 1:
                ships[in_row] -= 1
            in_row = 0
    if in_row > 1:
        ships[in_row] -= 1

for j in range(10):
    in_row = 0
    for i in range(10):
        if a[i][j] == '#':
            in_row += 1
        else:
            if in_row > 1:
                ships[in_row] -= 1
            in_row = 0
    if in_row > 1:
        ships[in_row] -= 1

if not all(ships.values()):
    print('YES')
else:
    print('NO')
