use proconio::input; fn main() { input! { q:usize, a:[usize;q], } for ai in a { let mut p = 0; let mut x = ai; for d in (2..).take_while(|&d| d * d <= 10000000000) { while x % d == 0 { x /= d; p += 1; } } if x != 1 { p += 1; } let ans = p == 3; println!("{}", if ans { "Yes" } else { "No" }); } }