import sys
d={}
for e in sys.stdin.readlines()[1:]:
 c,g=e.split()
 if'i'==c[0]:d[g]=0
 else:print(['no','yes'][g in d]) import sys sys d={} d {} for e in sys.stdin.readlines()[1:]:
 c,g=e.split()
 if'i'==c[0]:d[g]=0
 else:print(['no','yes'][g in d]) e sys.stdin.readlines()[1:] sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines 1: 1 c,g=e.split() c e.split() e.split e split g if'i'==c[0]:d[g]=0
 else:print(['no','yes'][g in d]) 'i'==c[0] 'i' c[0] c 0 c,g=e.split() e.split() c d={} {} d g=e.split() e.split() g
import sys
d={}
for e in sys.stdin.readlines()[1:]:
 c,g=e.split()
 if'i'==c[0]:d[g]=0
 else:print(['no','yes'][g in d])
