from collections import Counter n = int(input()) alist = list(map(int, input().split())) q = int(input()) xk = [list(map(int, input().split())) for i in range(q)] co = Counter(alist) for x,k in xk: if co[x] >= k: print("Yes") else: print("No")