arr = [list(input()) for i in range(10)]
figures = []
def get(y, x):
    if x < 0 or x >= 10 or y < 0 or y >= 10:
        return '.'
    else:
        return arr[y][x]
mainbreak = False
for y in range(10):
    for x in range(10):
        if get(y, x) == '#':
            if '#' in (get(y - 1, x - 1), get(y - 1, x + 1), get(y + 1, x - 1), get(y + 1, x + 1)):
                print('NO')
                mainbreak = True
                break
    if mainbreak:
        break
if not mainbreak:
    for y_ in range(10):
        for x_ in range(10):
          if get(y_, x_) == '#':
            figure = []
            figure_y, figure_x = y_, x_
            stack = [(0, 0)]
            was = {(0, 0)}
            while stack:
                y, x = stack.pop(-1)
                figure.append((y, x))
                arr[figure_y + y][figure_x + x] = '.'
                if get(figure_y + y, figure_x + x - 1) == '#' and (y, x - 1) not in was:
                    stack.append((y, x - 1))
                    was.add((y, x - 1))
                if get(figure_y + y, figure_x + x + 1) == '#' and (y, x + 1) not in was:
                    stack.append((y, x + 1))
                    was.add((y, x + 1))
                if get(figure_y + y - 1, figure_x + x) == '#' and (y - 1, x) not in was:
                    stack.append((y - 1, x))
                    was.add((y - 1, x))
                if get(figure_y + y + 1, figure_x + x) == '#' and (y + 1, x) not in was:
                    stack.append((y + 1, x))
                    was.add((y + 1, x))
            figure = sorted(figure)
            if figure == [(0, 0)]:
                figure = 1
            elif figure == [(0, 0), (1, 0)] or figure == [(0, 0), (0, 1)]:
                figure = 2
            elif figure == [(0, 0), (1, 0), (2, 0)] or figure == [(0, 0), (0, 1), (0, 2)]:
                figure = 3
            elif figure == [(0, 0), (1, 0), (2, 0), (3, 0)] or figure == [(0, 0), (0, 1), (0, 2), (0, 3)]:
                figure = 4
            else:
                figure = 0
            figures.append(figure)
    figures.sort()
    if figures == [1, 1, 1, 1, 2, 2, 2, 3, 3, 4]:
        print('YES')
    else:
        print('NO')