import math def suspect(a, t, n): x = pow(a, t, n) n1 = n - 1 while t != n1 and x != 1 and x != n1: x = pow(x, 2, n) t <<= 1 return t & 1 or x == n1 def miller_rabin(n): if n == 2: return True if n < 2 or n % 2 == 0: return False d = (n - 1) >> 1 while d & 1 == 0: d >>= 1 check_list = (2, 7, 61) if n < 2 ** 32 else (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37) for i in check_list: if i >= n: break if not suspect(i, d, n): return False return True T = int(input()) for t in range(T): N = int(input()) res = miller_rabin(N**4+4) if res == True: print('Yes') else: print('No') # print(ans) x = N**4 + 4 cnt = 0 while x % 10 == 0: x //= 10 cnt += 1 print(cnt)