using System.Linq; using System.Collections.Generic; using static System.Math; using System; public class Hello { static void Main() { var n = long.Parse(Console.ReadLine().Trim()); var a = GeneratePrime((int)Sqrt(n)); if (n <= 5) Console.WriteLine("NO"); else getAns(n, a); } static void getAns(long n, List a) { var count = 0; foreach (var x in a) { while (true) { if (n % x == 0) { count++; if (count >= 3) { Console.WriteLine("YES"); return; } n /= x; } else break; } } Console.WriteLine("NO"); } static List GeneratePrime(int m) { var a = new List(); int p; var sqrtMax = Math.Sqrt(m); var s = Enumerable.Range(2, m - 1).ToList(); do { p = s.First(); a.Add(p); s.RemoveAll(n => n % p == 0); } while (p < sqrtMax); a.AddRange(s); return a; } }