N,H = map(int,input().split()) A = list(map(int,input().split())) for i in A: if i%H == 0: print("YES") else: print(("NO"))