#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_4_C&lang=jp
#??????
if __name__ == "__main__":
    n_line = int(input())
    l = set([])
    for i in range(n_line):
        input_line = input().split()
        if input_line[0] == "insert":
            l.add(input_line[1])
        else:
            if input_line[1] in l:
                print("yes")
            else:
                print("no") if __name__ == "__main__":
    n_line = int(input())
    l = set([])
    for i in range(n_line):
        input_line = input().split()
        if input_line[0] == "insert":
            l.add(input_line[1])
        else:
            if input_line[1] in l:
                print("yes")
            else:
                print("no") __name__ == "__main__" __name__ "__main__" n_line = int(input()) n_line int(input()) int input() input l = set([]) l set([]) set [] for i in range(n_line):
        input_line = input().split()
        if input_line[0] == "insert":
            l.add(input_line[1])
        else:
            if input_line[1] in l:
                print("yes")
            else:
                print("no") i range(n_line) range n_line input_line = input().split() input_line input().split() ().split () input split if input_line[0] == "insert":
            l.add(input_line[1])
        else:
            if input_line[1] in l:
                print("yes")
            else:
                print("no") input_line[0] == "insert" input_line[0] input_line 0 "insert" l.add(input_line[1]) l.add l add input_line[1] input_line 1 if input_line[1] in l:
                print("yes")
            else:
                print("no") input_line[1] in l input_line[1] input_line 1 l print("yes") print "yes" print("no") print "no" input_line = input().split() input().split() input_line l = set([]) set([]) l n_line = int(input()) int(input()) n_line
#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_4_C&lang=jp
#??????
if __name__ == "__main__":
    n_line = int(input())
    l = set([])
    for i in range(n_line):
        input_line = input().split()
        if input_line[0] == "insert":
            l.add(input_line[1])
        else:
            if input_line[1] in l:
                print("yes")
            else:
                print("no")