use std::io::*; use std::str::FromStr; fn calc(n: i64, z: i64) -> String { let zpown = z.pow(n as u32); for x in 1..z { let xpown = x.pow(n as u32); let ypown = zpown - xpown; if xpown + ypown == zpown { return "Yes".to_string(); } } "No".to_string() } fn main() { let mut s = String::new(); stdin().read_line(&mut s).ok(); let mut it = s.split_whitespace(); let n = i64::from_str(it.next().unwrap()).unwrap(); let z = i64::from_str(it.next().unwrap()).unwrap(); if n >= 3 { println!("No"); } else { if z == 1 { println!("No"); } else { println!("{}", calc(n, z)); } } }