#define hash
class my_dict():
    def __init__(self, size=1000):
        self.my_list = [[] for i in range(size)]
        self.dict_size = size
    #quaternary A=0 C=1 G=2 T=3
    def acgt_hash(self, input_str):
        output = 0
        for i in input_str:
            if i == 'A':
                output+=1
            elif i == 'C':
                output+=2
            elif i == 'G':
                output+=3
            elif i == 'T':
                output+=4
            output *=5
        return output%self.dict_size
    def insert(self, key):
        hash_val = self.acgt_hash(key)
        if self.my_list[hash_val] == None:
            self.my_list[hash_val]  = [key]
        else:
            for k in self.my_list[hash_val]:
                if k == key:
                    break
            else: self.my_list[hash_val].append(key)
    def find(self, key):
        hash_val = self.acgt_hash(key)
        if self.my_list[hash_val] == None:
            print('no')
        else:
            for k in self.my_list[hash_val]:
                if k == key:
                    print('yes')
                    break
            else: print('no')

#get N
n = int(input())
#create dic
dic1 = my_dict(100000)
#get inputs in N times
for i in range(n):
    #get instructtion and key
    inst, key = input().split(' ')
    #do instructions
    if inst == 'insert':
        dic1.insert(key)
    else:
        dic1.find(key)


 class my_dict():
    def __init__(self, size=1000):
        self.my_list = [[] for i in range(size)]
        self.dict_size = size
    #quaternary A=0 C=1 G=2 T=3
    def acgt_hash(self, input_str):
        output = 0
        for i in input_str:
            if i == 'A':
                output+=1
            elif i == 'C':
                output+=2
            elif i == 'G':
                output+=3
            elif i == 'T':
                output+=4
            output *=5
        return output%self.dict_size
    def insert(self, key):
        hash_val = self.acgt_hash(key)
        if self.my_list[hash_val] == None:
            self.my_list[hash_val]  = [key]
        else:
            for k in self.my_list[hash_val]:
                if k == key:
                    break
            else: self.my_list[hash_val].append(key)
    def find(self, key):
        hash_val = self.acgt_hash(key)
        if self.my_list[hash_val] == None:
            print('no')
        else:
            for k in self.my_list[hash_val]:
                if k == key:
                    print('yes')
                    break
            else: print('no')

#get N my_dict def __init__(self, size=1000):
        self.my_list = [[] for i in range(size)]
        self.dict_size = size
    #quaternary A=0 C=1 G=2 T=3
     __init__ [] for i in range(size) for i in range(size) i range(size) range size for i in range(size) [] self.my_list = [[] for i in range(size)] self.my_list self my_list [[] for i in range(size)] self.dict_size = size self.dict_size self dict_size size self self size=1000 size 1000 def acgt_hash(self, input_str):
        output = 0
        for i in input_str:
            if i == 'A':
                output+=1
            elif i == 'C':
                output+=2
            elif i == 'G':
                output+=3
            elif i == 'T':
                output+=4
            output *=5
        return output%self.dict_size
     acgt_hash output = 0 output 0 for i in input_str:
            if i == 'A':
                output+=1
            elif i == 'C':
                output+=2
            elif i == 'G':
                output+=3
            elif i == 'T':
                output+=4
            output *=5
         i input_str if i == 'A':
                output+=1
            elif i == 'C':
                output+=2
            elif i == 'G':
                output+=3
            elif i == 'T':
                output+=4
             i == 'A' i 'A' output+=1 output 1 elif i == 'C':
                output+=2
             i == 'C' i 'C' output+=2 output 2 elif i == 'G':
                output+=3
             i == 'G' i 'G' output+=3 output 3 elif i == 'T':
                output+=4
             i == 'T' i 'T' output+=4 output 4 output *=5 output 5 return output%self.dict_size output%self.dict_size output self.dict_size self dict_size self self input_str input_str def insert(self, key):
        hash_val = self.acgt_hash(key)
        if self.my_list[hash_val] == None:
            self.my_list[hash_val]  = [key]
        else:
            for k in self.my_list[hash_val]:
                if k == key:
                    break
            else: self.my_list[hash_val].append(key)
     insert hash_val = self.acgt_hash(key) hash_val self.acgt_hash(key) self.acgt_hash self acgt_hash key if self.my_list[hash_val] == None:
            self.my_list[hash_val]  = [key]
        else:
            for k in self.my_list[hash_val]:
                if k == key:
                    break
            else: self.my_list[hash_val].append(key)
     self.my_list[hash_val] == None self.my_list[hash_val] self.my_list self my_list hash_val None self.my_list[hash_val]  = [key] self.my_list[hash_val] self.my_list self my_list hash_val [key] key for k in self.my_list[hash_val]:
                if k == key:
                    break
            else: self.my_list[hash_val].append(key)
     k self.my_list[hash_val] self.my_list self my_list hash_val if k == key:
                    break
             k == key k key break self self key key def find(self, key):
        hash_val = self.acgt_hash(key)
        if self.my_list[hash_val] == None:
            print('no')
        else:
            for k in self.my_list[hash_val]:
                if k == key:
                    print('yes')
                    break
            else: print('no')

#get N find hash_val = self.acgt_hash(key) hash_val self.acgt_hash(key) self.acgt_hash self acgt_hash key if self.my_list[hash_val] == None:
            print('no')
        else:
            for k in self.my_list[hash_val]:
                if k == key:
                    print('yes')
                    break
            else: print('no')

#get N self.my_list[hash_val] == None self.my_list[hash_val] self.my_list self my_list hash_val None print('no') print 'no' for k in self.my_list[hash_val]:
                if k == key:
                    print('yes')
                    break
            else: print('no')

#get N k self.my_list[hash_val] self.my_list self my_list hash_val if k == key:
                    print('yes')
                    break
             k == key k key print('yes') print 'yes' break self self key key n = int(input()) n int(input()) int input() input dic1 = my_dict(100000) dic1 my_dict(100000) my_dict 100000 for i in range(n):
    #get instructtion and key
    inst, key = input().split(' ')
    #do instructions
    if inst == 'insert':
        dic1.insert(key)
    else:
        dic1.find(key) i range(n) range n inst, key = input().split(' ') inst input().split(' ') ().split () input split ' ' key if inst == 'insert':
        dic1.insert(key)
    else:
        dic1.find(key) inst == 'insert' inst 'insert' dic1.insert(key) dic1.insert dic1 insert key dic1.find(key) dic1.find dic1 find key dic1 = my_dict(100000) my_dict(100000) dic1 key = input().split(' ') input().split(' ') key inst, key = input().split(' ') input().split(' ') inst n = int(input()) int(input()) n class my_dict():
    def __init__(self, size=1000):
        self.my_list = [[] for i in range(size)]
        self.dict_size = size
    #quaternary A=0 C=1 G=2 T=3
    def acgt_hash(self, input_str):
        output = 0
        for i in input_str:
            if i == 'A':
                output+=1
            elif i == 'C':
                output+=2
            elif i == 'G':
                output+=3
            elif i == 'T':
                output+=4
            output *=5
        return output%self.dict_size
    def insert(self, key):
        hash_val = self.acgt_hash(key)
        if self.my_list[hash_val] == None:
            self.my_list[hash_val]  = [key]
        else:
            for k in self.my_list[hash_val]:
                if k == key:
                    break
            else: self.my_list[hash_val].append(key)
    def find(self, key):
        hash_val = self.acgt_hash(key)
        if self.my_list[hash_val] == None:
            print('no')
        else:
            for k in self.my_list[hash_val]:
                if k == key:
                    print('yes')
                    break
            else: print('no')

#get N class my_dict():
    def __init__(self, size=1000):
        self.my_list = [[] for i in range(size)]
        self.dict_size = size
    #quaternary A=0 C=1 G=2 T=3
    def acgt_hash(self, input_str):
        output = 0
        for i in input_str:
            if i == 'A':
                output+=1
            elif i == 'C':
                output+=2
            elif i == 'G':
                output+=3
            elif i == 'T':
                output+=4
            output *=5
        return output%self.dict_size
    def insert(self, key):
        hash_val = self.acgt_hash(key)
        if self.my_list[hash_val] == None:
            self.my_list[hash_val]  = [key]
        else:
            for k in self.my_list[hash_val]:
                if k == key:
                    break
            else: self.my_list[hash_val].append(key)
    def find(self, key):
        hash_val = self.acgt_hash(key)
        if self.my_list[hash_val] == None:
            print('no')
        else:
            for k in self.my_list[hash_val]:
                if k == key:
                    print('yes')
                    break
            else: print('no')

#get N my_dict
#define hash
class my_dict():
    def __init__(self, size=1000):
        self.my_list = [[] for i in range(size)]
        self.dict_size = size
    #quaternary A=0 C=1 G=2 T=3
    def acgt_hash(self, input_str):
        output = 0
        for i in input_str:
            if i == 'A':
                output+=1
            elif i == 'C':
                output+=2
            elif i == 'G':
                output+=3
            elif i == 'T':
                output+=4
            output *=5
        return output%self.dict_size
    def insert(self, key):
        hash_val = self.acgt_hash(key)
        if self.my_list[hash_val] == None:
            self.my_list[hash_val]  = [key]
        else:
            for k in self.my_list[hash_val]:
                if k == key:
                    break
            else: self.my_list[hash_val].append(key)
    def find(self, key):
        hash_val = self.acgt_hash(key)
        if self.my_list[hash_val] == None:
            print('no')
        else:
            for k in self.my_list[hash_val]:
                if k == key:
                    print('yes')
                    break
            else: print('no')

#get N
n = int(input())
#create dic
dic1 = my_dict(100000)
#get inputs in N times
for i in range(n):
    #get instructtion and key
    inst, key = input().split(' ')
    #do instructions
    if inst == 'insert':
        dic1.insert(key)
    else:
        dic1.find(key)



