n = int(input()) s = set(map(int,input().split())) m = int(input()) for x in map(int,input().split()): if x in s: print("YES") else: print("NO")