from collections import deque

n = int(input())
dict = {}
for i in range(n):
    order = input().split()
    if order[0] == "insert":
        dict[order[1]] = i
    else:
        if order[1] in dict:
            print("yes")
        else:
            print("no") from collections import deque n = int(input()) n int(input()) int input() input dict = {} dict {} for i in range(n):
    order = input().split()
    if order[0] == "insert":
        dict[order[1]] = i
    else:
        if order[1] in dict:
            print("yes")
        else:
            print("no") i range(n) range n order = input().split() order input().split() ().split () input split if order[0] == "insert":
        dict[order[1]] = i
    else:
        if order[1] in dict:
            print("yes")
        else:
            print("no") order[0] == "insert" order[0] order 0 "insert" dict[order[1]] = i dict[order[1]] dict order[1] order 1 i if order[1] in dict:
            print("yes")
        else:
            print("no") order[1] in dict order[1] order 1 dict print("yes") print "yes" print("no") print "no" order = input().split() input().split() order dict = {} {} dict n = int(input()) int(input()) n
from collections import deque

n = int(input())
dict = {}
for i in range(n):
    order = input().split()
    if order[0] == "insert":
        dict[order[1]] = i
    else:
        if order[1] in dict:
            print("yes")
        else:
            print("no")