import sys
input()
d = {}
for s in sys.stdin:
    if s[0]=='i':
        d[s[7:]] = 1
    else:
        if s[5:] in d:
            print('yes')
        else:
            print('no') import sys sys input() input d = {} d {} for s in sys.stdin:
    if s[0]=='i':
        d[s[7:]] = 1
    else:
        if s[5:] in d:
            print('yes')
        else:
            print('no') s sys.stdin sys stdin if s[0]=='i':
        d[s[7:]] = 1
    else:
        if s[5:] in d:
            print('yes')
        else:
            print('no') s[0]=='i' s[0] s 0 'i' d[s[7:]] = 1 d[s[7:]] d s[7:] s 7: 7 1 if s[5:] in d:
            print('yes')
        else:
            print('no') s[5:] in d s[5:] s 5: 5 d print('yes') print 'yes' print('no') print 'no' d = {} {} d
import sys
input()
d = {}
for s in sys.stdin:
    if s[0]=='i':
        d[s[7:]] = 1
    else:
        if s[5:] in d:
            print('yes')
        else:
            print('no')
