if __name__ == "__main__":
    
    n = int(input())
    ops = []
    words = []
    for _ in range(n):
        op, word = input().split()
        ops.append(op)
        words.append(word)
    
    db = set()
    for op, word in zip(ops, words):
        if op=='insert':
            db.add(word)
        else:
            if word in db:
                print("yes")
            else:
                print("no")
 if __name__ == "__main__":
    
    n = int(input())
    ops = []
    words = []
    for _ in range(n):
        op, word = input().split()
        ops.append(op)
        words.append(word)
    
    db = set()
    for op, word in zip(ops, words):
        if op=='insert':
            db.add(word)
        else:
            if word in db:
                print("yes")
            else:
                print("no") __name__ == "__main__" __name__ "__main__" n = int(input()) n int(input()) int input() input ops = [] ops [] words = [] words [] for _ in range(n):
        op, word = input().split()
        ops.append(op)
        words.append(word)
    
     _ range(n) range n op, word = input().split() op input().split() ().split () input split word ops.append(op) ops.append ops append op words.append(word) words.append words append word db = set() db set() set for op, word in zip(ops, words):
        if op=='insert':
            db.add(word)
        else:
            if word in db:
                print("yes")
            else:
                print("no") op word zip(ops, words) zip ops words if op=='insert':
            db.add(word)
        else:
            if word in db:
                print("yes")
            else:
                print("no") op=='insert' op 'insert' db.add(word) db.add db add word if word in db:
                print("yes")
            else:
                print("no") word in db word db print("yes") print "yes" print("no") print "no" ops = [] [] ops op, word = input().split() input().split() op words = [] [] words db = set() set() db n = int(input()) int(input()) n word = input().split() input().split() word
if __name__ == "__main__":
    
    n = int(input())
    ops = []
    words = []
    for _ in range(n):
        op, word = input().split()
        ops.append(op)
        words.append(word)
    
    db = set()
    for op, word in zip(ops, words):
        if op=='insert':
            db.add(word)
        else:
            if word in db:
                print("yes")
            else:
                print("no")

