dic = {}

for i in range(int(input())):
  cmd, arg = input().split()
  if cmd == "insert":
    dic[arg] = 0
  else:
    if arg in dic:
      print("yes")
    else:
      print("no") dic = {} dic {} for i in range(int(input())):
  cmd, arg = input().split()
  if cmd == "insert":
    dic[arg] = 0
  else:
    if arg in dic:
      print("yes")
    else:
      print("no") i range(int(input())) range int(input()) int input() input cmd, arg = input().split() cmd input().split() ().split () input split arg if cmd == "insert":
    dic[arg] = 0
  else:
    if arg in dic:
      print("yes")
    else:
      print("no") cmd == "insert" cmd "insert" dic[arg] = 0 dic[arg] dic arg 0 if arg in dic:
      print("yes")
    else:
      print("no") arg in dic arg dic print("yes") print "yes" print("no") print "no" cmd, arg = input().split() input().split() cmd arg = input().split() input().split() arg dic = {} {} dic
dic = {}

for i in range(int(input())):
  cmd, arg = input().split()
  if cmd == "insert":
    dic[arg] = 0
  else:
    if arg in dic:
      print("yes")
    else:
      print("no")