# -*- coding: utf-8 -*-

n = int(raw_input())
dic = set()
for i in range(n):
    com, s = map(str, raw_input().split())
    if com == "insert":
        dic.add(s)
    elif com == "find":
        if s in dic:
            print "yes"
        else:
            print "no" n = int(raw_input()) n int(raw_input()) int raw_input() raw_input dic = set() dic set() set for i in range(n):
    com, s = map(str, raw_input().split())
    if com == "insert":
        dic.add(s)
    elif com == "find":
        if s in dic:
            print "yes"
        else:
            print "no" i range(n) range n com, s = map(str, raw_input().split()) com map(str, raw_input().split()) map str raw_input().split() ().split () raw_input split s if com == "insert":
        dic.add(s)
    elif com == "find":
        if s in dic:
            print "yes"
        else:
            print "no" com == "insert" com "insert" dic.add(s) dic.add dic add s elif com == "find":
        if s in dic:
            print "yes"
        else:
            print "no" com == "find" com "find" if s in dic:
            print "yes"
        else:
            print "no" s in dic s dic print print com, s = map(str, raw_input().split()) map(str, raw_input().split()) com s = map(str, raw_input().split()) map(str, raw_input().split()) s n = int(raw_input()) int(raw_input()) n dic = set() set() dic
# -*- coding: utf-8 -*-

n = int(raw_input())
dic = set()
for i in range(n):
    com, s = map(str, raw_input().split())
    if com == "insert":
        dic.add(s)
    elif com == "find":
        if s in dic:
            print "yes"
        else:
            print "no"