n = int(input())

s = set()

for _ in range(n):
    instruction, word = input().split()
    if instruction == 'insert':
        s.add(word)
    else:
        if word 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):
    instruction, word = input().split()
    if instruction == 'insert':
        s.add(word)
    else:
        if word in s:
            print('yes')
        else:
            print('no') _ range(n) range n instruction, word = input().split() instruction input().split() ().split () input split word if instruction == 'insert':
        s.add(word)
    else:
        if word in s:
            print('yes')
        else:
            print('no') instruction == 'insert' instruction 'insert' s.add(word) s.add s add word if word in s:
            print('yes')
        else:
            print('no') word in s word s print('yes') print 'yes' print('no') print 'no' instruction, word = input().split() input().split() instruction s = set() set() s n = int(input()) int(input()) n word = input().split() input().split() word
n = int(input())

s = set()

for _ in range(n):
    instruction, word = input().split()
    if instruction == 'insert':
        s.add(word)
    else:
        if word in s:
            print('yes')
        else:
            print('no')
