dict = {}
n = int(raw_input())
for _ in xrange(n):
  com, word = raw_input().split()
  if com == "insert":
    dict[word] = True
  else:
    if word in dict:
      print "yes"
    else:
      print "no" dict = {} dict {} n = int(raw_input()) n int(raw_input()) int raw_input() raw_input for _ in xrange(n):
  com, word = raw_input().split()
  if com == "insert":
    dict[word] = True
  else:
    if word in dict:
      print "yes"
    else:
      print "no" _ xrange(n) xrange n com, word = raw_input().split() com raw_input().split() ().split () raw_input split word if com == "insert":
    dict[word] = True
  else:
    if word in dict:
      print "yes"
    else:
      print "no" com == "insert" com "insert" dict[word] = True dict[word] dict word True if word in dict:
      print "yes"
    else:
      print "no" word in dict word dict print print n = int(raw_input()) int(raw_input()) n com, word = raw_input().split() raw_input().split() com word = raw_input().split() raw_input().split() word dict = {} {} dict
dict = {}
n = int(raw_input())
for _ in xrange(n):
  com, word = raw_input().split()
  if com == "insert":
    dict[word] = True
  else:
    if word in dict:
      print "yes"
    else:
      print "no"