Supermarket Dilemma
Chef is going to local supermarket but there appears a problem with chef as he is confused about which Supermarket he can choose to go as he is not able to decide whether he can park his car in that particular supermarket’s parking lot or not! There are N parking slots in each supermarket which are marked from 1,2,3,4…N.
Chef will go to that supermarket in which he gets to know that there is exactly 1 empty parking slot having number K that exactly divides the total number of slots (N) available in that supermarket.
The 1st and Nth parking slots are always occupied by the staff of every supermarket. Rest parking slots are empty as Chef is arriving early morning to the supermarket.
Now Chef needs your help in determining whether he can park his car in a supermarket or not!
Input
The first line contains the single integer N showing how many supermarkets are there for the chef to choose.
The next N lines contain a number ‘ai’ which represents the total parking slots available in ith supermarket.
Output
You need to output "YES" (without the quotes), if a supermarket can be reached by Chef, and "NO" (without the quotes), if it can't.
Constraints
1<=N<=10^5
1<=ai<=10^12
Sample Input :
2
4
5
Sample Output :
YES
NO

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = 'import math\r\n\r\ndef check(s):\r\n    if s==2:\r\n        return 1\r\n        \r\n    for i in range(2,math.ceil(math.sqrt(s))+1):\r\n        if s%i == 0:\r\n            return 0\r\n    \r\n    return 1\r\n        \r\n\r\ndef Solve(slots):\r\n  if slots<3:\r\n    return 0\r\n  \r\n  #check\r\n  s = math.sqrt(slots)\r\n  if math.floor(s) == math.ceil(s):\r\n      return check(s)\r\n      \r\n  return 0\r\n\r\n\r\nN = int(input())\r\n\r\nfor t in range(N):\r\n  \r\n  slots = int(input())\r\n  \r\n  if (Solve(slots)):\r\n    print("YES")\r\n  \r\n  else:\r\n    print("NO")'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13211