#![allow(unused_imports)] #![allow(non_snake_case)] use std::collections::HashMap; use std::collections::HashSet; #[allow(unused_macros)] macro_rules! read { ([$t:ty] ; $n:expr) => ((0..$n).map(|_| read!([$t])).collect::>()); ($($t:ty),+ ; $n:expr) => ((0..$n).map(|_| read!($($t),+)).collect::>()); ([$t:ty]) => (rl().split_whitespace().map(|w| w.parse().unwrap()).collect::>()); ($t:ty) => (rl().parse::<$t>().unwrap()); ($($t:ty),*) => {{ let buf = rl(); let mut w = buf.split_whitespace(); ($(w.next().unwrap().parse::<$t>().unwrap()),*) }}; } #[allow(dead_code)] fn rl() -> String { let mut buf = String::new(); std::io::stdin().read_line(&mut buf).unwrap(); buf.trim_end().to_owned() } fn main() { let n = read!(u64); let sqrtn = (n as f64).sqrt() as usize; let primes = primes(sqrtn); let num = primes .into_iter() .enumerate() .skip(1) .filter(|(i, _)| n % (*i as u64) == 0) .count(); if num >= 2 { println!("YES"); } else { println!("NO"); } } fn primes(n: usize) -> Vec:: { if n < 2 { return vec![]; } let mut table = vec![true; n+1]; table[0] = false; table[1] = false; for i in 2..=(n as f64).sqrt() as usize { if table[i] == false { continue; } let mut j = i*i; while j <= n { table[j] = false; j += i; } } table .iter() .enumerate() .filter(|(_, &flg)| flg) .map(|(num, _)| num) .collect() }