n = int(input())
l = {}
for _ in range(n):
    ss = input().split()
    order, string = ss[0], ss[1]
    if order == "insert":
        l[string] = 1
    else:
        print('yes' if string in l else 'no') n = int(input()) n int(input()) int input() input l = {} l {} for _ in range(n):
    ss = input().split()
    order, string = ss[0], ss[1]
    if order == "insert":
        l[string] = 1
    else:
        print('yes' if string in l else 'no') _ range(n) range n ss = input().split() ss input().split() ().split () input split order, string = ss[0], ss[1] order ss[0] ss 0 string ss[1] ss 1 if order == "insert":
        l[string] = 1
    else:
        print('yes' if string in l else 'no') order == "insert" order "insert" l[string] = 1 l[string] l string 1 print('yes' if string in l else 'no') print 'yes' if string in l else 'no' string in l string l 'yes' 'no' n = int(input()) int(input()) n ss = input().split() input().split() ss string = ss[0], ss[1] ss[1] string l = {} {} l order, string = ss[0], ss[1] ss[0] order
n = int(input())
l = {}
for _ in range(n):
    ss = input().split()
    order, string = ss[0], ss[1]
    if order == "insert":
        l[string] = 1
    else:
        print('yes' if string in l else 'no')