Is the number prime?
Print YES if N is a prime number and NO otherwise (1 is not prime).
Reported in: TCS NQT (8 May 2024) (memory-based)
Input
One line: N.
Output
YES or NO.
Constraints
1 ≤ N ≤ 10^12.
Example 1
Input:
17
Output:
YESExample 2
Input:
1
Output:
NOExample 3
Input:
91
Output:
NOHint: Try dividing by every number from 2 up to √N; if none divides N (and N > 1), it is prime.