Is N prime
InterviewTime limit1sMemory limit256 MB
Given an integer N, decide whether N is prime and print Yes or No. The trailing line of N integers is unused.
- Level
Easy2 of 10
- Topics
- Math, Number theory, Brute force
- Solved
- No attempts yet
Problem
You are given an integer . Print Yes if is prime, and No otherwise.
A prime number is an integer greater than whose only positive divisors are and itself.
Input
The first line contains an integer .
The second line contains integers. Each integer is at least and strictly less than .
Output
Print Yes if is prime. Print No otherwise.