import sys

n = int(input())
dic = set()

for i in range(n):
    cmd = sys.stdin.readline().split()

    if cmd[0] == "insert":
        dic.add(cmd[1])
    else:
        print("yes" if cmd[1] in dic else "no") import sys sys n = int(input()) n int(input()) int input() input dic = set() dic set() set for i in range(n):
    cmd = sys.stdin.readline().split()

    if cmd[0] == "insert":
        dic.add(cmd[1])
    else:
        print("yes" if cmd[1] in dic else "no") i range(n) range n cmd = sys.stdin.readline().split() cmd sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split if cmd[0] == "insert":
        dic.add(cmd[1])
    else:
        print("yes" if cmd[1] in dic else "no") cmd[0] == "insert" cmd[0] cmd 0 "insert" dic.add(cmd[1]) dic.add dic add cmd[1] cmd 1 print("yes" if cmd[1] in dic else "no") print "yes" if cmd[1] in dic else "no" cmd[1] in dic cmd[1] cmd 1 dic "yes" "no" dic = set() set() dic cmd = sys.stdin.readline().split() sys.stdin.readline().split() cmd n = int(input()) int(input()) n
import sys

n = int(input())
dic = set()

for i in range(n):
    cmd = sys.stdin.readline().split()

    if cmd[0] == "insert":
        dic.add(cmd[1])
    else:
        print("yes" if cmd[1] in dic else "no")