#K69417. Prime Book Selector
Prime Book Selector
Prime Book Selector
You are given the number of books T and a list of page counts for each book. For each page count, you need to determine if it is a prime number. A number p is considered prime if it is greater than 1 and has no divisors other than 1 and p. In mathematical terms,
\( p > 1 \) and \( \nexists\; a \; (1 < a < p) \; such \; that \; p \mod a = 0 \).
For each page count, output "YES" if it is a prime number, or "NO" if it is not. This problem tests your knowledge of basic number theory and efficient primality testing.
inputFormat
The first line contains an integer T, the number of books. The second line contains T space-separated integers representing the page counts of each book.
outputFormat
For each page count given in the input, output a line containing either "YES" if the page count is a prime number or "NO" otherwise.
## sample3
29 15 23
YES
NO
YES
</p>