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