def is_valid_battleship_placement(grid):
    ship_sizes = [4, 3, 3, 2, 2, 2, 1, 1, 1, 1]
    row_count = len(grid)
    col_count = len(grid[0])
    
    for size in ship_sizes:
        found = False
        for row in range(row_count):
            for col in range(col_count):
                if grid[row][col] == '#':
                    # Check if we can place the ship horizontally
                    if col + size <= col_count and all(grid[row][col+i] == '#' for i in range(size)):
                        found = True
                        for i in range(size):
                            grid[row][col+i] = '.'
                        break
                    # Check if we can place the ship vertically
                    elif row + size <= row_count and all(grid[row+i][col] == '#' for i in range(size)):
                        found = True
                        for i in range(size):
                            grid[row+i][col] = '.'
                        break
            if found:
                break
        if not found:
            return False
    
    # Check if there are no remaining ships
    for row in grid:
        if '#' in row:
            return False
    
    return True

# Read input
grid = [list(input()) for _ in range(10)]

# Check if the placement is valid and print the result
if is_valid_battleship_placement(grid):
    print("YES")
else:
    print("NO")
