use std::io; fn main() { let v = input_nums(); let (x, a, y, b) = (v[0], v[1], v[2], v[3]); let (mut num, deno) = (x, y); let mut y_count = b; let mut x_count = a; for _i in 0..(a + b) { if num % deno == 0 { num /= deno; y_count -= 1; if y_count == 0 { println!("Yes"); break; } } else { num *= x; x_count -= 1; if x_count == 0 { println!("No"); break; } } } } fn input_nums() -> Vec { let mut s = String::new(); io::stdin().read_line(&mut s).unwrap(); let mut v = Vec::new(); for n in s.split_whitespace() { v.push(n.parse().unwrap()); } v }