import sys

if __name__ == "__main__":
    n = int(sys.stdin.readline())
    inp = sys.stdin.readlines()
    lis = set()
    for i in range(n):
        com = inp[i].split()
        if com[0] == "insert":
            lis.add(com[1])
        elif com[1] in lis:
            print("yes")
        else:
            print("no") import sys sys if __name__ == "__main__":
    n = int(sys.stdin.readline())
    inp = sys.stdin.readlines()
    lis = set()
    for i in range(n):
        com = inp[i].split()
        if com[0] == "insert":
            lis.add(com[1])
        elif com[1] in lis:
            print("yes")
        else:
            print("no") __name__ == "__main__" __name__ "__main__" n = int(sys.stdin.readline()) n int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline inp = sys.stdin.readlines() inp sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines lis = set() lis set() set for i in range(n):
        com = inp[i].split()
        if com[0] == "insert":
            lis.add(com[1])
        elif com[1] in lis:
            print("yes")
        else:
            print("no") i range(n) range n com = inp[i].split() com inp[i].split() [i].split [i] inp i split if com[0] == "insert":
            lis.add(com[1])
        elif com[1] in lis:
            print("yes")
        else:
            print("no") com[0] == "insert" com[0] com 0 "insert" lis.add(com[1]) lis.add lis add com[1] com 1 elif com[1] in lis:
            print("yes")
         com[1] in lis com[1] com 1 lis print("yes") print "yes" print("no") print "no" inp = sys.stdin.readlines() sys.stdin.readlines() inp com = inp[i].split() inp[i].split() com n = int(sys.stdin.readline()) int(sys.stdin.readline()) n lis = set() set() lis
import sys

if __name__ == "__main__":
    n = int(sys.stdin.readline())
    inp = sys.stdin.readlines()
    lis = set()
    for i in range(n):
        com = inp[i].split()
        if com[0] == "insert":
            lis.add(com[1])
        elif com[1] in lis:
            print("yes")
        else:
            print("no")