fn main() { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let mut n: Vec = s.split_whitespace().flat_map(str::parse).collect(); let mut b = n[1]; while n[1] > 0 { (n[0], n[1]) = (n[1], n[0] % n[1]) } b /= n[0]; while b % 2 == 0 { b /= 2 } while b % 5 == 0 { b /= 5 } println!("{}", if b > 1 { "Yes" } else { "No" }) }