# define a list of tuples, each containing the ship length and count
ship_info = [(4, 1), (3, 2), (2, 3), (1, 4)]

def is_valid_ship_placement(grid, row, col, ship_len, horizontal):
    if horizontal:
        for j in range(col, col + ship_len):
            if grid[row][j] != '#':
                return False
    else:
        for j in range(row, row + ship_len):
            if grid[j][col] != '#':
                return False
    return True

def check_placement(grid):
    # iterate through the grid and check for valid ship placements
    for row in range(10):
        for col in range(10):
            if grid[row][col] == '#':
                for ship_len, count in ship_info:
                    # check for valid placements horizontally
                    if col + ship_len <= 10 and is_valid_ship_placement(grid, row, col, ship_len, True):
                        count -= 1
                        if count == 0:
                            break
                    # check for valid placements vertically
                    if row + ship_len <= 10 and is_valid_ship_placement(grid, row, col, ship_len, False):
                        count -= 1
                        if count == 0:
                            break
                else:
                    return False
    return True

# read the input grid
grid = []
for _ in range(10):
    row = input().strip()
    grid.append(list(row))

# check the grid and print the result
if check_placement(grid):
    print("YES")
else:
    print("NO")
