n = input()
dic = set()
 
for i in range(n):
  com, st = map(str, raw_input().split())
  if com == 'insert':
    dic.add(st)
  elif com == 'find':
    if st in dic:
      print 'yes'
    else:
      print 'no' n = input() n input() input dic = set() dic set() set for i in range(n):
  com, st = map(str, raw_input().split())
  if com == 'insert':
    dic.add(st)
  elif com == 'find':
    if st in dic:
      print 'yes'
    else:
      print 'no' i range(n) range n com, st = map(str, raw_input().split()) com map(str, raw_input().split()) map str raw_input().split() ().split () raw_input split st if com == 'insert':
    dic.add(st)
  elif com == 'find':
    if st in dic:
      print 'yes'
    else:
      print 'no' com == 'insert' com 'insert' dic.add(st) dic.add dic add st elif com == 'find':
    if st in dic:
      print 'yes'
    else:
      print 'no' com == 'find' com 'find' if st in dic:
      print 'yes'
    else:
      print 'no' st in dic st dic print print st = map(str, raw_input().split()) map(str, raw_input().split()) st n = input() input() n dic = set() set() dic com, st = map(str, raw_input().split()) map(str, raw_input().split()) com
n = input()
dic = set()
 
for i in range(n):
  com, st = map(str, raw_input().split())
  if com == 'insert':
    dic.add(st)
  elif com == 'find':
    if st in dic:
      print 'yes'
    else:
      print 'no'