class diction:
    def __init__(self):
        self.D = {}
    def insert(self,string):
        self.D[string] = True
    def find(self,string):
        try:
            if self.D[string]:print('yes')
        except KeyError:
            print('no')
            
D = diction()
for _ in range(int(input())):
    command,string = input().split()
    if command == 'insert':
        D.insert(string)
    elif command == 'find':
        D.find(string) class diction:
    def __init__(self):
        self.D = {}
    def insert(self,string):
        self.D[string] = True
    def find(self,string):
        try:
            if self.D[string]:print('yes')
        except KeyError:
            print('no')
             diction def __init__(self):
        self.D = {}
     __init__ self.D = {} self.D self D {} self self def insert(self,string):
        self.D[string] = True
     insert self.D[string] = True self.D[string] self.D self D string True self self string string def find(self,string):
        try:
            if self.D[string]:print('yes')
        except KeyError:
            print('no')
             find try:
            if self.D[string]:print('yes')
        except KeyError:
            print('no')
             except KeyError:
            print('no')
             print('no') print 'no' if self.D[string]:print('yes')
         self.D[string] self.D self D string self self string string D = diction() D diction() diction for _ in range(int(input())):
    command,string = input().split()
    if command == 'insert':
        D.insert(string)
    elif command == 'find':
        D.find(string) _ range(int(input())) range int(input()) int input() input command,string = input().split() command input().split() ().split () input split string if command == 'insert':
        D.insert(string)
    elif command == 'find':
        D.find(string) command == 'insert' command 'insert' D.insert(string) D.insert D insert string elif command == 'find':
        D.find(string) command == 'find' command 'find' D.find(string) D.find D find string string = input().split() input().split() string D = diction() diction() D command,string = input().split() input().split() command class diction:
    def __init__(self):
        self.D = {}
    def insert(self,string):
        self.D[string] = True
    def find(self,string):
        try:
            if self.D[string]:print('yes')
        except KeyError:
            print('no')
             class diction:
    def __init__(self):
        self.D = {}
    def insert(self,string):
        self.D[string] = True
    def find(self,string):
        try:
            if self.D[string]:print('yes')
        except KeyError:
            print('no')
             diction
class diction:
    def __init__(self):
        self.D = {}
    def insert(self,string):
        self.D[string] = True
    def find(self,string):
        try:
            if self.D[string]:print('yes')
        except KeyError:
            print('no')
            
D = diction()
for _ in range(int(input())):
    command,string = input().split()
    if command == 'insert':
        D.insert(string)
    elif command == 'find':
        D.find(string)
