dic=dict()
n = int(input())
for i in range(n):
    a = input()
    t=a.split()
    if t[0] == "insert":
        dic[t[1]] = True
    else:
        if t[1] in dic:
            print("yes")
        else:
            print("no") dic=dict() dic dict() dict n = int(input()) n int(input()) int input() input for i in range(n):
    a = input()
    t=a.split()
    if t[0] == "insert":
        dic[t[1]] = True
    else:
        if t[1] in dic:
            print("yes")
        else:
            print("no") i range(n) range n a = input() a input() input t=a.split() t a.split() a.split a split if t[0] == "insert":
        dic[t[1]] = True
    else:
        if t[1] in dic:
            print("yes")
        else:
            print("no") t[0] == "insert" t[0] t 0 "insert" dic[t[1]] = True dic[t[1]] dic t[1] t 1 True if t[1] in dic:
            print("yes")
        else:
            print("no") t[1] in dic t[1] t 1 dic print("yes") print "yes" print("no") print "no" n = int(input()) int(input()) n a = input() input() a t=a.split() a.split() t dic=dict() dict() dic
dic=dict()
n = int(input())
for i in range(n):
    a = input()
    t=a.split()
    if t[0] == "insert":
        dic[t[1]] = True
    else:
        if t[1] in dic:
            print("yes")
        else:
            print("no")