# -*- coding: utf-8 -*-

import sys
import os


N = int(sys.stdin.readline())
lines = sys.stdin.readlines()
d = {}
for s in lines:
    command, word = s.split()
    if command == 'insert':
        d[word] = True
    elif command == 'find':
        if word in d.keys():
            print('yes')
        else:
            print('no') import sys sys import os os N = int(sys.stdin.readline()) N int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline lines = sys.stdin.readlines() lines sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines d = {} d {} for s in lines:
    command, word = s.split()
    if command == 'insert':
        d[word] = True
    elif command == 'find':
        if word in d.keys():
            print('yes')
        else:
            print('no') s lines command, word = s.split() command s.split() s.split s split word if command == 'insert':
        d[word] = True
    elif command == 'find':
        if word in d.keys():
            print('yes')
        else:
            print('no') command == 'insert' command 'insert' d[word] = True d[word] d word True elif command == 'find':
        if word in d.keys():
            print('yes')
        else:
            print('no') command == 'find' command 'find' if word in d.keys():
            print('yes')
        else:
            print('no') word in d.keys() word d.keys() d.keys d keys print('yes') print 'yes' print('no') print 'no' d = {} {} d lines = sys.stdin.readlines() sys.stdin.readlines() lines N = int(sys.stdin.readline()) int(sys.stdin.readline()) N command, word = s.split() s.split() command word = s.split() s.split() word
# -*- coding: utf-8 -*-

import sys
import os


N = int(sys.stdin.readline())
lines = sys.stdin.readlines()
d = {}
for s in lines:
    command, word = s.split()
    if command == 'insert':
        d[word] = True
    elif command == 'find':
        if word in d.keys():
            print('yes')
        else:
            print('no')