n = int(input())

strs = {}

for i in range(n):
    s = input().split()
    if(s[0] == 'insert'):
        if(s[1] not in strs):
            strs[s[1]] = ''
    else:
        if(s[1] in strs):
            print('yes')
        else:
            print('no') n = int(input()) n int(input()) int input() input strs = {} strs {} for i in range(n):
    s = input().split()
    if(s[0] == 'insert'):
        if(s[1] not in strs):
            strs[s[1]] = ''
    else:
        if(s[1] in strs):
            print('yes')
        else:
            print('no') i range(n) range n s = input().split() s input().split() ().split () input split if(s[0] == 'insert'):
        if(s[1] not in strs):
            strs[s[1]] = ''
    else:
        if(s[1] in strs):
            print('yes')
        else:
            print('no') s[0] == 'insert' s[0] s 0 'insert' if(s[1] not in strs):
            strs[s[1]] = ''
     s[1] not in strs s[1] s 1 strs strs[s[1]] = '' strs[s[1]] strs s[1] s 1 '' if(s[1] in strs):
            print('yes')
        else:
            print('no') s[1] in strs s[1] s 1 strs print('yes') print 'yes' print('no') print 'no' strs = {} {} strs n = int(input()) int(input()) n s = input().split() input().split() s
n = int(input())

strs = {}

for i in range(n):
    s = input().split()
    if(s[0] == 'insert'):
        if(s[1] not in strs):
            strs[s[1]] = ''
    else:
        if(s[1] in strs):
            print('yes')
        else:
            print('no')
