n=gets.to_i co=false if n==Math.sqrt(n) puts 'NO' co=true end unless co n.times do |i| i=i.succ.succ if i>=n break end if n.modulo(i).zero? puts 'NO' co=true break end end end unless co puts 'YES' end