#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

_dict = dict()

n = int(sys.stdin.readline())
for i in range(n):
    cmd, word = sys.stdin.readline().split()
    if cmd == 'insert':
        _dict[word] = True
    elif cmd == 'find':
        if word in _dict:
            print('yes')
        else:
            print('no')
 import sys sys _dict = dict() _dict dict() dict n = int(sys.stdin.readline()) n int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline for i in range(n):
    cmd, word = sys.stdin.readline().split()
    if cmd == 'insert':
        _dict[word] = True
    elif cmd == 'find':
        if word in _dict:
            print('yes')
        else:
            print('no') i range(n) range n cmd, word = sys.stdin.readline().split() cmd sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split word if cmd == 'insert':
        _dict[word] = True
    elif cmd == 'find':
        if word in _dict:
            print('yes')
        else:
            print('no') cmd == 'insert' cmd 'insert' _dict[word] = True _dict[word] _dict word True elif cmd == 'find':
        if word in _dict:
            print('yes')
        else:
            print('no') cmd == 'find' cmd 'find' if word in _dict:
            print('yes')
        else:
            print('no') word in _dict word _dict print('yes') print 'yes' print('no') print 'no' word = sys.stdin.readline().split() sys.stdin.readline().split() word cmd, word = sys.stdin.readline().split() sys.stdin.readline().split() cmd n = int(sys.stdin.readline()) int(sys.stdin.readline()) n _dict = dict() dict() _dict
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

_dict = dict()

n = int(sys.stdin.readline())
for i in range(n):
    cmd, word = sys.stdin.readline().split()
    if cmd == 'insert':
        _dict[word] = True
    elif cmd == 'find':
        if word in _dict:
            print('yes')
        else:
            print('no')

