import sys
def m():
 d={}
 for e in sys.stdin.readlines()[1:]:
  if'f'==e[0]:print('yes'if e[5:]in d else'no')
  else:d[e[7:]]=0
if'__main__'==__name__:m() import sys sys def m():
 d={}
 for e in sys.stdin.readlines()[1:]:
  if'f'==e[0]:print('yes'if e[5:]in d else'no')
  else:d[e[7:]]=0 m d={} d {} for e in sys.stdin.readlines()[1:]:
  if'f'==e[0]:print('yes'if e[5:]in d else'no')
  else:d[e[7:]]=0 e sys.stdin.readlines()[1:] sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines 1: 1 if'f'==e[0]:print('yes'if e[5:]in d else'no')
  else:d[e[7:]]=0 'f'==e[0] 'f' e[0] e 0 if'__main__'==__name__:m() '__main__'==__name__ '__main__' __name__ def m():
 d={}
 for e in sys.stdin.readlines()[1:]:
  if'f'==e[0]:print('yes'if e[5:]in d else'no')
  else:d[e[7:]]=0 def m():
 d={}
 for e in sys.stdin.readlines()[1:]:
  if'f'==e[0]:print('yes'if e[5:]in d else'no')
  else:d[e[7:]]=0 m
import sys
def m():
 d={}
 for e in sys.stdin.readlines()[1:]:
  if'f'==e[0]:print('yes'if e[5:]in d else'no')
  else:d[e[7:]]=0
if'__main__'==__name__:m()
