def is_valid_battleship(board):
    ship_lengths = [4, 3, 3, 2, 2, 2, 1, 1, 1, 1]

    def is_valid_ship_placement(ship_length):
        for i in range(10):
            for j in range(10):
                if board[i][j] == '#':
                    if j + ship_length <= 10 and all(board[i][j + k] == '#' for k in range(ship_length)):
                        for k in range(ship_length):
                            board[i][j + k] = 'x'
                        return True
                    elif i + ship_length <= 10 and all(board[i + k][j] == '#' for k in range(ship_length)):
                        for k in range(ship_length):
                            board[i + k][j] = 'x'
                        return True
        return False

    for length in ship_lengths:
        if not is_valid_ship_placement(length):
            return "NO"
    return "YES"

board = [list(input()) for _ in range(10)]

result = is_valid_battleship(board)
print(result)
