Checking if a number is prime
Python
Easy
math
Task «Checking if a number is prime»
Write a program that checks whether a given natural number is prime. A prime number is a natural number greater than 1 that has only two divisors: 1 and itself. The program should output "YES" if the number is prime, and "NO" otherwise. Constraint: the number does not exceed 10^9.
Input Format
One integer n (1 ≤ n ≤ 10^9).
Output Format
String "YES" or "NO".
Examples
Example 1
INPUT
2
OUTPUT
YES
main.py