from sys import stdin

n = int(input())
set_ = set()

for _ in range(n):
    cmd, s = stdin.readline().split()

    if cmd == "insert":
        set_.add(s)
    if cmd == "find":
        ans = ["no", "yes"][s in set_]
        print(ans)
 from sys import stdin n = int(input()) n int(input()) int input() input set_ = set() set_ set() set for _ in range(n):
    cmd, s = stdin.readline().split()

    if cmd == "insert":
        set_.add(s)
    if cmd == "find":
        ans = ["no", "yes"][s in set_]
        print(ans) _ range(n) range n cmd, s = stdin.readline().split() cmd stdin.readline().split() stdin.readline().split stdin.readline() stdin.readline stdin readline split s if cmd == "insert":
        set_.add(s)
     cmd == "insert" cmd "insert" set_.add(s) set_.add set_ add s if cmd == "find":
        ans = ["no", "yes"][s in set_]
        print(ans) cmd == "find" cmd "find" ans = ["no", "yes"][s in set_] ans ["no", "yes"][s in set_] ["no", "yes"] "no" "yes" s in set_ s set_ print(ans) print ans ans = ["no", "yes"][s in set_] ["no", "yes"][s in set_] ans set_ = set() set() set_ s = stdin.readline().split() stdin.readline().split() s cmd, s = stdin.readline().split() stdin.readline().split() cmd n = int(input()) int(input()) n
from sys import stdin

n = int(input())
set_ = set()

for _ in range(n):
    cmd, s = stdin.readline().split()

    if cmd == "insert":
        set_.add(s)
    if cmd == "find":
        ans = ["no", "yes"][s in set_]
        print(ans)

