import sys



n = int(eval(input()))

dic = {}

input_ = [x.split() for x in sys.stdin.readlines()]



for c, s in input_:

    if c == 'insert':

        dic[s] = 0

    else:

        if s in dic:

            print('yes')

        else:

            print('no')
import sys



n = int(eval(input()))

dic = {}

input_ = sys.stdin.readlines()



for i in input_:

    c, s = i.split()

    if c == 'insert':

        dic[s] = 0

    else:

        if s in dic:

            print('yes')

        else:

            print('no')
import sys

n = int(eval(input()))
dic = {}
input_ = [x.split() for x in sys.stdin.readlines()]
for c, s in input_:
    if c == "insert":
        dic[s] = 0
    else:
        if s in dic:
            print("yes")
        else:
            print("no")

import sys

n = int(eval(input()))
dic = {}
input_ = sys.stdin.readlines()
for i in input_:
    c, s = i.split()
    if c == "insert":
        dic[s] = 0
    else:
        if s in dic:
            print("yes")
        else:
            print("no")

-input_ = [x.split() for x in sys.stdin.readlines()] -for c, s in input_: +input_ = sys.stdin.readlines() +for i in input_: +    c, s = i.split()