from collections import* n=int(input()) a=Counter(input().split()) for i in range(int(input())): n,k=input().split() print("YNeos"[a[n]