n = int(eval(input()))

dictionary = {}

for i in range(n):

    a = input().split()

    if a[0] == "insert":

        dictionary[a[1]] = 0

    if a[0] == "find":

        if a[1] in dictionary:

            print("yes")

        else:

            print("no") 
import sys

n = int(eval(input()))

dictionary = {}



k = sys.stdin.readlines()





for j in k:

    i = j.split()

    if i[0] == "insert":

        dictionary[i[1]] = 0

    else:

        if i[1] in dictionary:

            print("yes")

        else:

            print("no") 

        
n = int(eval(input()))
dictionary = {}
for i in range(n):
    a = input().split()
    if a[0] == "insert":
        dictionary[a[1]] = 0
    if a[0] == "find":
        if a[1] in dictionary:
            print("yes")
        else:
            print("no")

import sys

n = int(eval(input()))
dictionary = {}
k = sys.stdin.readlines()
for j in k:
    i = j.split()
    if i[0] == "insert":
        dictionary[i[1]] = 0
    else:
        if i[1] in dictionary:
            print("yes")
        else:
            print("no")

+import sys + -for i in range(n): -    a = input().split() -    if a[0] == "insert": -        dictionary[a[1]] = 0 -    if a[0] == "find": -        if a[1] in dictionary: +k = sys.stdin.readlines() +for j in k: +    i = j.split() +    if i[0] == "insert": +        dictionary[i[1]] = 0 +    else: +        if i[1] in dictionary: