def readinput():
    n=int(input())
    commands = []
    for i in range(n):
        command=input().split()
        commands.append(command)
    return n, commands

def main(n,commands):
    d = dict()
    for cmd in commands:
        if(cmd[0]=='insert'):
            d[cmd[1]]=cmd[1]
        elif(cmd[0]=='find'):
            if(cmd[1] in d):
                print('yes')
            else:
                print('no')

if __name__=='__main__':
    n,commands=readinput()
    main(n,commands)
 def readinput():
    n=int(input())
    commands = []
    for i in range(n):
        command=input().split()
        commands.append(command)
    return n, commands readinput n=int(input()) n int(input()) int input() input commands = [] commands [] for i in range(n):
        command=input().split()
        commands.append(command)
     i range(n) range n command=input().split() command input().split() ().split () input split commands.append(command) commands.append commands append command return n, commands return n, commands n commands def main(n,commands):
    d = dict()
    for cmd in commands:
        if(cmd[0]=='insert'):
            d[cmd[1]]=cmd[1]
        elif(cmd[0]=='find'):
            if(cmd[1] in d):
                print('yes')
            else:
                print('no') main d = dict() d dict() dict for cmd in commands:
        if(cmd[0]=='insert'):
            d[cmd[1]]=cmd[1]
        elif(cmd[0]=='find'):
            if(cmd[1] in d):
                print('yes')
            else:
                print('no') cmd commands if(cmd[0]=='insert'):
            d[cmd[1]]=cmd[1]
        elif(cmd[0]=='find'):
            if(cmd[1] in d):
                print('yes')
            else:
                print('no') cmd[0]=='insert' cmd[0] cmd 0 'insert' d[cmd[1]]=cmd[1] d[cmd[1]] d cmd[1] cmd 1 cmd[1] cmd 1 elif(cmd[0]=='find'):
            if(cmd[1] in d):
                print('yes')
            else:
                print('no') cmd[0]=='find' cmd[0] cmd 0 'find' if(cmd[1] in d):
                print('yes')
            else:
                print('no') cmd[1] in d cmd[1] cmd 1 d print('yes') print 'yes' print('no') print 'no' n n commands commands if __name__=='__main__':
    n,commands=readinput()
    main(n,commands) __name__=='__main__' __name__ '__main__' n,commands=readinput() n readinput() readinput commands main(n,commands) main n commands n,commands=readinput() readinput() n commands=readinput() readinput() commands def readinput():
    n=int(input())
    commands = []
    for i in range(n):
        command=input().split()
        commands.append(command)
    return n, commands def readinput():
    n=int(input())
    commands = []
    for i in range(n):
        command=input().split()
        commands.append(command)
    return n, commands readinput def main(n,commands):
    d = dict()
    for cmd in commands:
        if(cmd[0]=='insert'):
            d[cmd[1]]=cmd[1]
        elif(cmd[0]=='find'):
            if(cmd[1] in d):
                print('yes')
            else:
                print('no') def main(n,commands):
    d = dict()
    for cmd in commands:
        if(cmd[0]=='insert'):
            d[cmd[1]]=cmd[1]
        elif(cmd[0]=='find'):
            if(cmd[1] in d):
                print('yes')
            else:
                print('no') main
def readinput():
    n=int(input())
    commands = []
    for i in range(n):
        command=input().split()
        commands.append(command)
    return n, commands

def main(n,commands):
    d = dict()
    for cmd in commands:
        if(cmd[0]=='insert'):
            d[cmd[1]]=cmd[1]
        elif(cmd[0]=='find'):
            if(cmd[1] in d):
                print('yes')
            else:
                print('no')

if __name__=='__main__':
    n,commands=readinput()
    main(n,commands)

