Dict = set()
n = int(input())
for i in range(n):
 C = input().split()
 if C[0] =="insert":
  Dict.add(C[1])
 else:
  if C[1] in Dict:
   print("yes")
  else:
   print("no") Dict = set() Dict set() set n = int(input()) n int(input()) int input() input for i in range(n):
 C = input().split()
 if C[0] =="insert":
  Dict.add(C[1])
 else:
  if C[1] in Dict:
   print("yes")
  else:
   print("no") i range(n) range n C = input().split() C input().split() ().split () input split if C[0] =="insert":
  Dict.add(C[1])
 else:
  if C[1] in Dict:
   print("yes")
  else:
   print("no") C[0] =="insert" C[0] C 0 "insert" Dict.add(C[1]) Dict.add Dict add C[1] C 1 if C[1] in Dict:
   print("yes")
  else:
   print("no") C[1] in Dict C[1] C 1 Dict print("yes") print "yes" print("no") print "no" Dict = set() set() Dict C = input().split() input().split() C n = int(input()) int(input()) n
Dict = set()
n = int(input())
for i in range(n):
 C = input().split()
 if C[0] =="insert":
  Dict.add(C[1])
 else:
  if C[1] in Dict:
   print("yes")
  else:
   print("no")