require 'prime' def pn_div(n, pn_from = nil) pns = Prime.each(Math.sqrt(n).to_i).to_a pns.select!{|pn| pn >= pn_from} if pn_from pns.each do |pn| q, r = n.divmod(pn) return pn, q if r == 0 end return nil end N = gets.to_i n1, n2 = pn_div(N) n1, n2 = pn_div(n2, n1) if n1 puts n1 ? "YES" : "NO"