Problem:
Score : 100 points

Problem Statement

You are given a three-digit positive integer N.

Determine whether N is a palindromic number.

Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Constraints

100≤N≤999

N is an integer.

Input

Input is given from Standard Input in the following format:

N

Output

If N is a palindromic number, print Yes; otherwise, print No.

Sample Input 1

575

Sample Output 1

Yes

N=575 is also 575 when read backward, so it is a palindromic number. You should print Yes.

Sample Input 2

123

Sample Output 2

No

N=123 becomes 321 when read backward, so it is not a palindromic number. You should print No.

Sample Input 3

812

Sample Output 3

No

Solution in Rust (1.15.1) (judge verdict: Runtime Error)

use std::collections::HashMap;

fn collect_primes(n: u64) -> HashMap<u64, u32> {
    let mut primes = HashMap::<u64, u32>::new();
    let mut cur = n;
    let mut i = 2_u64;
    if n == 1 {
        primes.insert(1, 1);
        return primes;
    }
    while i != cur {
        if cur % i  == 0 {
            *(primes.entry(i).or_insert(0)) += 1;
            cur /= i;
            continue;
        }
        i += 1;
    }
    // primes.entry(cur).and_modify(|i| *i=*i+1).or_insert(1);
    if primes.get(&i).is_some() {
        let v = primes.get_mut(&i).unwrap();
        *v = *v + 1;
    } else {
        primes.insert(cur, 1);
    }

    primes
}

fn union_primes(l: HashMap<u64, u32>, r: HashMap<u64,u32>) -> HashMap<u64,u32>{
    let mut nprimes = l.clone();
    let t = 0;
    for p1 in l.keys() {
        let lp = l.get(p1).unwrap();
        let rp = r.get(p1).unwrap_or(&t);
        if lp > rp {
            nprimes.insert(*p1, *lp);
        } else {
            nprimes.insert(*p1, *rp);
        }
    }
    for p2 in r.keys() {
        let n = *(nprimes.get(p2).unwrap_or(&0));
        let rp = r.get(p2).unwrap();
        if n < *rp {
            nprimes.entry(*p2).or_insert(*rp);
        }
    }
    nprimes
}

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}


fn main() {
    input! {
        n : usize,
        tx : [[u64; 1]; n],
    }
    let mut base = HashMap::<u64,u32>::new();
    for i in 0 .. n {
        let prime = collect_primes( tx[i][0] );
        base = union_primes(base, prime);
        // println!("{:?}", base);
    }
    let mut ans = 1u64;
    for (k,v) in base.iter() {
        ans *= (*k).pow(*v);
    }
    println!("{}", ans)
}