n = int(input())

A = {}

for i in range(n):
    a, b = input().split()
    if a[0] == "i":
        A[b] = 1
    elif a[0] == "f":
        if b in A:
            print("yes")
        else:
            print("no") 
 n = int(input()) n int(input()) int input() input A = {} A {} for i in range(n):
    a, b = input().split()
    if a[0] == "i":
        A[b] = 1
    elif a[0] == "f":
        if b in A:
            print("yes")
        else:
            print("no")  i range(n) range n a, b = input().split() a input().split() ().split () input split b if a[0] == "i":
        A[b] = 1
    elif a[0] == "f":
        if b in A:
            print("yes")
        else:
            print("no")  a[0] == "i" a[0] a 0 "i" A[b] = 1 A[b] A b 1 elif a[0] == "f":
        if b in A:
            print("yes")
        else:
            print("no")  a[0] == "f" a[0] a 0 "f" if b in A:
            print("yes")
        else:
            print("no")  b in A b A print("yes") print "yes" print("no") print "no" b = input().split() input().split() b n = int(input()) int(input()) n a, b = input().split() input().split() a A = {} {} A
n = int(input())

A = {}

for i in range(n):
    a, b = input().split()
    if a[0] == "i":
        A[b] = 1
    elif a[0] == "f":
        if b in A:
            print("yes")
        else:
            print("no") 

