import sys
n = int(input())
d = set()
for i in sys.stdin:
    c, s = i.split()
    if c == 'insert':
        d.add(s)
    else:
        print('yes' if s in d else 'no') import sys sys n = int(input()) n int(input()) int input() input d = set() d set() set for i in sys.stdin:
    c, s = i.split()
    if c == 'insert':
        d.add(s)
    else:
        print('yes' if s in d else 'no') i sys.stdin sys stdin c, s = i.split() c i.split() i.split i split s if c == 'insert':
        d.add(s)
    else:
        print('yes' if s in d else 'no') c == 'insert' c 'insert' d.add(s) d.add d add s print('yes' if s in d else 'no') print 'yes' if s in d else 'no' s in d s d 'yes' 'no' d = set() set() d s = i.split() i.split() s n = int(input()) int(input()) n c, s = i.split() i.split() c
import sys
n = int(input())
d = set()
for i in sys.stdin:
    c, s = i.split()
    if c == 'insert':
        d.add(s)
    else:
        print('yes' if s in d else 'no')
