Prime Machine
Isn't ancient Egypt absolutely fascinating? The inspiring architecture, mystical culture, and stunning fashion sense make it a place worth spending a whole day or two exploring.
Luckily, you don't have to just dream it! You and your friends recently got your hands on one of Adelaide University's latest inventions: the Prime Machine. This incredible time machine lets you travel back to any year that is a prime number.
Note: A prime number is a number greater than 1 that is only divisible evenly by 1 and itself. For example, 5 is prime, but 6 is not, because it can be divided into 2 groups of 3.
Annoyingly, your friends can't agree on which year to visit: each has picked some year (BC). For each of these years, determine whether the Prime Machine can take you there, that is, whether the year is a prime number.
Note: Number
is divisible by number
if and only if \(A \: \% \: B = 0\).
Input
The first line contains a single integer, (
), the number of friends who are going to travel with you.
The next line contains integers
(
), where
is the year that your
th friend wants to travel to.
Output
For each proposed year, output "Yes" if the prime machine can take you there, that is, if that year is a prime. Otherwise output "No". Each output should be on its own line.
Example
Input 1
3
30 2763 67
Output 1
No
No
Yes
is not prime,
.
is not prime,
.
is prime.
Input 2
8
3100 3100 30 31 40 41 50 51
Output 1
No
No
No
Yes
No
Yes
No
No
Comments