import sys

def m():

 d={0};eval(input())

 for e in sys.stdin:

  if'f'==e[0]:print((['no','yes'][e[5:]in d]))

  else:d|={e[7:]}

if'__main__'==__name__:m()

import sys

def m():

 d={};eval(input())

 for e in sys.stdin:

  if'f'==e[0]:print((['no','yes'][e[5:]in d]))

  else:d[e[7:]]=0

if'__main__'==__name__:m()

import sys


def m():
    d = {0}
    eval(input())
    for e in sys.stdin:
        if "f" == e[0]:
            print((["no", "yes"][e[5:] in d]))
        else:
            d |= {e[7:]}


if "__main__" == __name__:
    m()

import sys


def m():
    d = {}
    eval(input())
    for e in sys.stdin:
        if "f" == e[0]:
            print((["no", "yes"][e[5:] in d]))
        else:
            d[e[7:]] = 0


if "__main__" == __name__:
    m()

-    d = {0} +    d = {} -            d |= {e[7:]} +            d[e[7:]] = 0