PRIONPRI - Prime or not Prime!


In this problem, your task is to determine if a given number is a prime number or a composite number.

Input

The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows. Each test case consists of a single line containing a single integer « n » (2 ≤ n ≤ 109).

Output

For each test case, your program should output a single line containing « YES » (without quotes and spaces) if the given integer is prime or « NO » (without quotes and spaces) if the given integer is a composite number.

Example

Input:
6
16
127
256
513
2048
5097

Output:
NO
YES
NO
NO
NO
NO

hide comments
sonicsplasher: 2022-06-24 16:52:57

Mine keeps throwing wrong answers, My output is a very simple "YES" or "NO". I've checked edge cases. I am on python. Does somebody what could possibly be wrong.

bravura_coder: 2021-07-08 09:47:21

good question

ayush_06: 2020-12-31 17:00:59

simple prime problem


Added by:mbk_live
Date:2019-01-08
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:C-CLANG C NCSHARP C++ 4.3.2 CPP CPP14 CPP14-CLANG C99 JAVA JULIA PYTHON PYPY3 PYTHON3 SWIFT