n = int(input())
s = set([])
for i in range(n):
    cmd, str1 = input().split()
    if cmd == "insert":
        s.add(str1)
    else:
        if str1 in s:
            print("yes")
        else:
            print("no") n = int(input()) n int(input()) int input() input s = set([]) s set([]) set [] for i in range(n):
    cmd, str1 = input().split()
    if cmd == "insert":
        s.add(str1)
    else:
        if str1 in s:
            print("yes")
        else:
            print("no") i range(n) range n cmd, str1 = input().split() cmd input().split() ().split () input split str1 if cmd == "insert":
        s.add(str1)
    else:
        if str1 in s:
            print("yes")
        else:
            print("no") cmd == "insert" cmd "insert" s.add(str1) s.add s add str1 if str1 in s:
            print("yes")
        else:
            print("no") str1 in s str1 s print("yes") print "yes" print("no") print "no" cmd, str1 = input().split() input().split() cmd s = set([]) set([]) s str1 = input().split() input().split() str1 n = int(input()) int(input()) n
n = int(input())
s = set([])
for i in range(n):
    cmd, str1 = input().split()
    if cmd == "insert":
        s.add(str1)
    else:
        if str1 in s:
            print("yes")
        else:
            print("no")
