macro_rules! read_to_tuple { ( $( $t:ty ),* ) => {{ let mut input = String::new(); std::io::stdin().read_line(&mut input).unwrap(); let mut iter = input.split_whitespace(); ( $( iter.next().unwrap().parse::<$t>().unwrap() ),* ) }}; } fn read_line_to_vec() -> Vec { let mut input = String::new(); std::io::stdin().read_line(&mut input).unwrap(); let iter = input.split_whitespace(); iter.map(|x| x.parse().ok().unwrap()).collect::>() } fn main() { let (n, mut h) = read_to_tuple!(usize, i64); let a = read_line_to_vec::(); let gcd = |mut a, mut b| { let mut r = a % b; while r != 0 { a = b; b = r; r = a % b; } b }; for i in 0..n { h /= gcd(a[i], h); } println!("{}", if h == 1 { "YES" } else { "NO" }); }