字典
n=int(input()) a={} for i in range(n): p=list(input().split()) if p[0]=='I': a[p[1]]=1 else: if p[1] in a: print("Yes") else: print("No")