#! /usr/bin/env python
# -*- coding: utf-8 -*-

''' ?????? '''


class Dictionary(object):
    """ Dictionary """

    def __init__(self):
        self.dict = {}

    def insert(self, x):
        self.dict[x] = 0

    def find(self, x):
        if x in self.dict.keys():
            print('yes')
        else:
            print('no')

if __name__ == '__main__':
    N = int(input())

    d = Dictionary()

    for _ in range(N):
        command, key = list(input().split())
        if command == 'insert':
            d.insert(key)
        elif command == 'find':
            d.find(key) ''' ?????? ''' class Dictionary(object):
    """ Dictionary """

    def __init__(self):
        self.dict = {}

    def insert(self, x):
        self.dict[x] = 0

    def find(self, x):
        if x in self.dict.keys():
            print('yes')
        else:
            print('no') Dictionary """ Dictionary """ def __init__(self):
        self.dict = {}

     __init__ self.dict = {} self.dict self dict {} self self def insert(self, x):
        self.dict[x] = 0

     insert self.dict[x] = 0 self.dict[x] self.dict self dict x 0 self self x x def find(self, x):
        if x in self.dict.keys():
            print('yes')
        else:
            print('no') find if x in self.dict.keys():
            print('yes')
        else:
            print('no') x in self.dict.keys() x self.dict.keys() self.dict.keys self.dict self dict keys print('yes') print 'yes' print('no') print 'no' self self x x object if __name__ == '__main__':
    N = int(input())

    d = Dictionary()

    for _ in range(N):
        command, key = list(input().split())
        if command == 'insert':
            d.insert(key)
        elif command == 'find':
            d.find(key) __name__ == '__main__' __name__ '__main__' N = int(input()) N int(input()) int input() input d = Dictionary() d Dictionary() Dictionary for _ in range(N):
        command, key = list(input().split())
        if command == 'insert':
            d.insert(key)
        elif command == 'find':
            d.find(key) _ range(N) range N command, key = list(input().split()) command list(input().split()) list input().split() ().split () input split key if command == 'insert':
            d.insert(key)
        elif command == 'find':
            d.find(key) command == 'insert' command 'insert' d.insert(key) d.insert d insert key elif command == 'find':
            d.find(key) command == 'find' command 'find' d.find(key) d.find d find key N = int(input()) int(input()) N key = list(input().split()) list(input().split()) key class Dictionary(object):
    """ Dictionary """

    def __init__(self):
        self.dict = {}

    def insert(self, x):
        self.dict[x] = 0

    def find(self, x):
        if x in self.dict.keys():
            print('yes')
        else:
            print('no') class Dictionary(object):
    """ Dictionary """

    def __init__(self):
        self.dict = {}

    def insert(self, x):
        self.dict[x] = 0

    def find(self, x):
        if x in self.dict.keys():
            print('yes')
        else:
            print('no') Dictionary command, key = list(input().split()) list(input().split()) command d = Dictionary() Dictionary() d
#! /usr/bin/env python
# -*- coding: utf-8 -*-

''' ?????? '''


class Dictionary(object):
    """ Dictionary """

    def __init__(self):
        self.dict = {}

    def insert(self, x):
        self.dict[x] = 0

    def find(self, x):
        if x in self.dict.keys():
            print('yes')
        else:
            print('no')

if __name__ == '__main__':
    N = int(input())

    d = Dictionary()

    for _ in range(N):
        command, key = list(input().split())
        if command == 'insert':
            d.insert(key)
        elif command == 'find':
            d.find(key)