n = int(input())
s = set()
for _ in range(n):
    i = input()
    if i[0] == 'i':
        s |= {i[7:]}
    else:
        if i[5:] in s:
            print('yes')
        else:
            print('no')
 n = int(input()) n int(input()) int input() input s = set() s set() set for _ in range(n):
    i = input()
    if i[0] == 'i':
        s |= {i[7:]}
    else:
        if i[5:] in s:
            print('yes')
        else:
            print('no') _ range(n) range n i = input() i input() input if i[0] == 'i':
        s |= {i[7:]}
    else:
        if i[5:] in s:
            print('yes')
        else:
            print('no') i[0] == 'i' i[0] i 0 'i' s |= {i[7:]} s {i[7:]} if i[5:] in s:
            print('yes')
        else:
            print('no') i[5:] in s i[5:] i 5: 5 s print('yes') print 'yes' print('no') print 'no' i = input() input() i n = int(input()) int(input()) n s |= {i[7:]} {i[7:]} s s = set() set() s
n = int(input())
s = set()
for _ in range(n):
    i = input()
    if i[0] == 'i':
        s |= {i[7:]}
    else:
        if i[5:] in s:
            print('yes')
        else:
            print('no')

