class Dictionary_class:
    def __init__(self):
        self.dic = set()

    def insert(self, str):
        self.dic.add(str)

    def find(self, str):
        if str in self.dic:
            return True
        else:
            return False

n = int(input())
answer = ""
dic = Dictionary_class()
for i in range(n):
    instruction = input().split()
    if instruction[0] == "insert":
        dic.insert(instruction[1])
    elif instruction[0] == "find":
        if dic.find(instruction[1]):
            answer += "yes\n"
        else:
            answer += "no\n"
print(answer, end = "") class Dictionary_class:
    def __init__(self):
        self.dic = set()

    def insert(self, str):
        self.dic.add(str)

    def find(self, str):
        if str in self.dic:
            return True
        else:
            return False Dictionary_class def __init__(self):
        self.dic = set()

     __init__ self.dic = set() self.dic self dic set() set self self def insert(self, str):
        self.dic.add(str)

     insert self.dic.add(str) self.dic.add self.dic self dic add str self self str str def find(self, str):
        if str in self.dic:
            return True
        else:
            return False find if str in self.dic:
            return True
        else:
            return False str in self.dic str self.dic self dic return True True return False False self self str str n = int(input()) n int(input()) int input() input answer = "" answer "" dic = Dictionary_class() dic Dictionary_class() Dictionary_class for i in range(n):
    instruction = input().split()
    if instruction[0] == "insert":
        dic.insert(instruction[1])
    elif instruction[0] == "find":
        if dic.find(instruction[1]):
            answer += "yes\n"
        else:
            answer += "no\n" i range(n) range n instruction = input().split() instruction input().split() ().split () input split if instruction[0] == "insert":
        dic.insert(instruction[1])
    elif instruction[0] == "find":
        if dic.find(instruction[1]):
            answer += "yes\n"
        else:
            answer += "no\n" instruction[0] == "insert" instruction[0] instruction 0 "insert" dic.insert(instruction[1]) dic.insert dic insert instruction[1] instruction 1 elif instruction[0] == "find":
        if dic.find(instruction[1]):
            answer += "yes\n"
        else:
            answer += "no\n" instruction[0] == "find" instruction[0] instruction 0 "find" if dic.find(instruction[1]):
            answer += "yes\n"
        else:
            answer += "no\n" dic.find(instruction[1]) dic.find dic find instruction[1] instruction 1 answer += "yes\n" answer "yes\n" answer += "no\n" answer "no\n" print(answer, end = "") print answer end = "" end "" answer = "" "" answer answer += "no\n" "no\n" answer dic = Dictionary_class() Dictionary_class() dic n = int(input()) int(input()) n answer += "yes\n" "yes\n" answer class Dictionary_class:
    def __init__(self):
        self.dic = set()

    def insert(self, str):
        self.dic.add(str)

    def find(self, str):
        if str in self.dic:
            return True
        else:
            return False class Dictionary_class:
    def __init__(self):
        self.dic = set()

    def insert(self, str):
        self.dic.add(str)

    def find(self, str):
        if str in self.dic:
            return True
        else:
            return False Dictionary_class instruction = input().split() input().split() instruction
class Dictionary_class:
    def __init__(self):
        self.dic = set()

    def insert(self, str):
        self.dic.add(str)

    def find(self, str):
        if str in self.dic:
            return True
        else:
            return False

n = int(input())
answer = ""
dic = Dictionary_class()
for i in range(n):
    instruction = input().split()
    if instruction[0] == "insert":
        dic.insert(instruction[1])
    elif instruction[0] == "find":
        if dic.find(instruction[1]):
            answer += "yes\n"
        else:
            answer += "no\n"
print(answer, end = "")