pub mod scanner { pub struct Scanner { buf: Vec, } impl Scanner { pub fn new() -> Self { Self { buf: vec![] } } pub fn new_from(source: &str) -> Self { let source = String::from(source); let buf = Self::split(source); Self { buf } } pub fn next(&mut self) -> T { loop { if let Some(x) = self.buf.pop() { return x.parse().ok().expect(""); } let mut source = String::new(); std::io::stdin().read_line(&mut source).expect(""); self.buf = Self::split(source); } } fn split(source: String) -> Vec { source .split_whitespace() .rev() .map(String::from) .collect::>() } } } use crate::scanner::Scanner; fn main() { let mut scanner = Scanner::new(); let t = 1; for _ in 0..t { solve(&mut scanner); } } fn solve(scanner: &mut Scanner) { let n: usize = scanner.next(); let mut m = 1; while (m+1) * (m+1) <= n { m += 1; } let mut is_prime = vec![true; m+1]; is_prime[0] = false; is_prime[1] = false; for i in 2..=m { if is_prime[i] { let mut j = i.pow(2); while j <= m { is_prime[j] = false; j += i; } } } let mut p = 0; let mut q = 0; let mut a = 0; let mut b = 0; let mut flag = false; for i in 2..=m { let mut x = n; if is_prime[i] { let mut cnt = 0; while x % i == 0 { x /= i; cnt += 1; } if cnt > 0 { p = i; a = cnt; for j in i+1..=m { let mut y = x; if is_prime[j] { cnt = 0; while y % j == 0 { y /= j; cnt += 1; } if y == 1 { q = j; b = cnt; flag = true; break; } } } } } if flag { break; } } if flag { println!("Yes"); println!("{}^{}*{}^{}", p, a, q, b); } else { println!("No"); } }