print((function (f) return f(io.stdin:read("*n"),#"",#"_",#"__") and "YES" or "NO" end)(function (n, Z, O, T) for i=T,math.floor(math.sqrt(n)) do if n%i==Z then return false end end return n~=O end))