N=int(input()) A=list(map(int,input().split())) ans=[] for a in A: if a in {1,4,6}: print("No") else: print("Yes")