require 'prime' n=gets.to_i n2=n ps=[] Prime.each(10**7) do |p1| if p1*p1<=n then while n2%p1==0 ps<1 if ps.size>2 then puts "YES" else puts "NO" end