T = int(input()) N = list(map(int,input().split())) for i in range(T): a = N[i] if a in [1,4,6]: print("No") else: print("Yes")