def is_valid_battleship_board(board):
    ship_sizes = [4, 3, 3, 2, 2, 2, 1, 1, 1, 1]
    
    def is_valid_ship_placement(board, size):
        for row in range(10):
            for col in range(10 - size + 1):
                if all(board[row][col + i] == "#" for i in range(size)):
                    for i in range(size):
                        board[row][col + i] = "."
                    return True
        for row in range(10 - size + 1):
            for col in range(10):
                if all(board[row + i][col] == "#" for i in range(size)):
                    for i in range(size):
                        board[row + i][col] = "."
                    return True
        return False
    
    for size in ship_sizes:
        if not is_valid_ship_placement(board, size):
            return "NO"
    
    return "YES"

# Ввод поля
board = [list(input()) for _ in range(10)]

# Проверка и вывод результата
print(is_valid_battleship_board(board))