n = int(input())
dict = set()
for i in range(n):
  a,b = input().split()
  if a=="insert":
    dict.add(b)
  else:
    if b in dict:
      print("yes")
    else:
      print("no") n = int(input()) n int(input()) int input() input dict = set() dict set() set for i in range(n):
  a,b = input().split()
  if a=="insert":
    dict.add(b)
  else:
    if b in dict:
      print("yes")
    else:
      print("no") i range(n) range n a,b = input().split() a input().split() ().split () input split b if a=="insert":
    dict.add(b)
  else:
    if b in dict:
      print("yes")
    else:
      print("no") a=="insert" a "insert" dict.add(b) dict.add dict add b if b in dict:
      print("yes")
    else:
      print("no") b in dict b dict print("yes") print "yes" print("no") print "no" a,b = input().split() input().split() a dict = set() set() dict b = input().split() input().split() b n = int(input()) int(input()) n
n = int(input())
dict = set()
for i in range(n):
  a,b = input().split()
  if a=="insert":
    dict.add(b)
  else:
    if b in dict:
      print("yes")
    else:
      print("no")
