n= int(input())
s= set()
for _ in range(n):
    a,b= input().split()
    if a=="insert":
        s.add(b)
    elif b in s:
        print("yes")
    else:
        print("no")
 n= int(input()) n int(input()) int input() input s= set() s set() set for _ in range(n):
    a,b= input().split()
    if a=="insert":
        s.add(b)
    elif b in s:
        print("yes")
    else:
        print("no") _ range(n) range n a,b= input().split() a input().split() ().split () input split b if a=="insert":
        s.add(b)
    elif b in s:
        print("yes")
    else:
        print("no") a=="insert" a "insert" s.add(b) s.add s add b elif b in s:
        print("yes")
     b in s b s print("yes") print "yes" print("no") print "no" b= input().split() input().split() b a,b= input().split() input().split() a n= int(input()) int(input()) n s= set() set() s
n= int(input())
s= set()
for _ in range(n):
    a,b= input().split()
    if a=="insert":
        s.add(b)
    elif b in s:
        print("yes")
    else:
        print("no")

