n = int(input())
dic = {}
ans = []

for i in range(n):
    com = input().split()
    c = com[0]

    if com[1] in dic:
        if c[0] == 'f': ans.append("yes")
        else: pass

    else:
        if c[0] == 'i': dic[ com[1] ] = i
        else: ans.append("no")


for i in ans: print(i)
 n = int(input()) n int(input()) int input() input dic = {} dic {} ans = [] ans [] for i in range(n):
    com = input().split()
    c = com[0]

    if com[1] in dic:
        if c[0] == 'f': ans.append("yes")
        else: pass

    else:
        if c[0] == 'i': dic[ com[1] ] = i
        else: ans.append("no") i range(n) range n com = input().split() com input().split() ().split () input split c = com[0] c com[0] com 0 if com[1] in dic:
        if c[0] == 'f': ans.append("yes")
        else: pass

    else:
        if c[0] == 'i': dic[ com[1] ] = i
        else: ans.append("no") com[1] in dic com[1] com 1 dic if c[0] == 'f': ans.append("yes")
        else: pass

     c[0] == 'f' c[0] c 0 'f' if c[0] == 'i': dic[ com[1] ] = i
        else: ans.append("no") c[0] == 'i' c[0] c 0 'i' for i in ans: print(i) i ans com = input().split() input().split() com ans = [] [] ans dic = {} {} dic c = com[0] com[0] c n = int(input()) int(input()) n
n = int(input())
dic = {}
ans = []

for i in range(n):
    com = input().split()
    c = com[0]

    if com[1] in dic:
        if c[0] == 'f': ans.append("yes")
        else: pass

    else:
        if c[0] == 'i': dic[ com[1] ] = i
        else: ans.append("no")


for i in ans: print(i)

