n = int(input())
dictionary = {}
for _ in range(n):
    command, word = input().split()
    if command == 'insert':
        dictionary[word] = word
    else:
        if dictionary.get(word) != None:
            print('yes')
        else:
            print('no') n = int(input()) n int(input()) int input() input dictionary = {} dictionary {} for _ in range(n):
    command, word = input().split()
    if command == 'insert':
        dictionary[word] = word
    else:
        if dictionary.get(word) != None:
            print('yes')
        else:
            print('no') _ range(n) range n command, word = input().split() command input().split() ().split () input split word if command == 'insert':
        dictionary[word] = word
    else:
        if dictionary.get(word) != None:
            print('yes')
        else:
            print('no') command == 'insert' command 'insert' dictionary[word] = word dictionary[word] dictionary word word if dictionary.get(word) != None:
            print('yes')
        else:
            print('no') dictionary.get(word) != None dictionary.get(word) dictionary.get dictionary get word None print('yes') print 'yes' print('no') print 'no' dictionary = {} {} dictionary command, word = input().split() input().split() command n = int(input()) int(input()) n word = input().split() input().split() word
n = int(input())
dictionary = {}
for _ in range(n):
    command, word = input().split()
    if command == 'insert':
        dictionary[word] = word
    else:
        if dictionary.get(word) != None:
            print('yes')
        else:
            print('no')
