import sys
input = sys.stdin.readline


N = int(input())
d = dict()

for _ in range(N):
    op, key = input().strip().split()
    if op == "insert":
        d[key] = True
    elif op == "find" and key in d.keys():
        print("yes")
    else:
        print("no")
 import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline N = int(input()) N int(input()) int input() input d = dict() d dict() dict for _ in range(N):
    op, key = input().strip().split()
    if op == "insert":
        d[key] = True
    elif op == "find" and key in d.keys():
        print("yes")
    else:
        print("no") _ range(N) range N op, key = input().strip().split() op input().strip().split() ().strip().split ().strip() ().strip () input strip split key if op == "insert":
        d[key] = True
    elif op == "find" and key in d.keys():
        print("yes")
    else:
        print("no") op == "insert" op "insert" d[key] = True d[key] d key True elif op == "find" and key in d.keys():
        print("yes")
     op == "find" and key in d.keys() op == "find" op "find" key in d.keys() key d.keys() d.keys d keys print("yes") print "yes" print("no") print "no" op, key = input().strip().split() input().strip().split() op key = input().strip().split() input().strip().split() key input = sys.stdin.readline sys.stdin.readline input d = dict() dict() d N = int(input()) int(input()) N
import sys
input = sys.stdin.readline


N = int(input())
d = dict()

for _ in range(N):
    op, key = input().strip().split()
    if op == "insert":
        d[key] = True
    elif op == "find" and key in d.keys():
        print("yes")
    else:
        print("no")

