"""
n=int(input())
s=[int(x) for x in input().split()]
q=int(input())
t=[int(x) for x in input().split()]
#print(s)
c=0
for i in t:
    if i in s:
        c+=1
print(c)
"""
"""
n=int(input())
s=[int(x) for x in input().split()]
q=int(input())
t=[int(x) for x in input().split()]
#binary search
a=0
for i in range(q):
    L=0
    R=n-1#探索する方の配列(s)はソート済みでないといけない
    while L<=R:
        M=(L+R)//2
        if s[M]<t[i]:
            L=M+1
        elif s[M]>t[i]:
            R=M-1
        else:
            a+=1
            break
print(a)
"""
#Dictionary
#dict型オブジェクトに対しinを使うとキーの存在確認になる
n=int(input())
d={}
for i in range(n):
    command,words=input().split()
    if command=='find':
        if words in d:
            print('yes')
        else:
            print('no')
    else:
        d[words]=0
 """
n=int(input())
s=[int(x) for x in input().split()]
q=int(input())
t=[int(x) for x in input().split()]
#print(s)
c=0
for i in t:
    if i in s:
        c+=1
print(c)
""" """
n=int(input())
s=[int(x) for x in input().split()]
q=int(input())
t=[int(x) for x in input().split()]
#binary search
a=0
for i in range(q):
    L=0
    R=n-1#探索する方の配列(s)はソート済みでないといけない
    while L<=R:
        M=(L+R)//2
        if s[M]<t[i]:
            L=M+1
        elif s[M]>t[i]:
            R=M-1
        else:
            a+=1
            break
print(a)
""" n=int(input()) n int(input()) int input() input d={} d {} for i in range(n):
    command,words=input().split()
    if command=='find':
        if words in d:
            print('yes')
        else:
            print('no')
    else:
        d[words]=0 i range(n) range n command,words=input().split() command input().split() ().split () input split words if command=='find':
        if words in d:
            print('yes')
        else:
            print('no')
    else:
        d[words]=0 command=='find' command 'find' if words in d:
            print('yes')
        else:
            print('no')
     words in d words d print('yes') print 'yes' print('no') print 'no' d[words]=0 d[words] d words 0 words=input().split() input().split() words command,words=input().split() input().split() command n=int(input()) int(input()) n d={} {} d
"""
n=int(input())
s=[int(x) for x in input().split()]
q=int(input())
t=[int(x) for x in input().split()]
#print(s)
c=0
for i in t:
    if i in s:
        c+=1
print(c)
"""
"""
n=int(input())
s=[int(x) for x in input().split()]
q=int(input())
t=[int(x) for x in input().split()]
#binary search
a=0
for i in range(q):
    L=0
    R=n-1#探索する方の配列(s)はソート済みでないといけない
    while L<=R:
        M=(L+R)//2
        if s[M]<t[i]:
            L=M+1
        elif s[M]>t[i]:
            R=M-1
        else:
            a+=1
            break
print(a)
"""
#Dictionary
#dict型オブジェクトに対しinを使うとキーの存在確認になる
n=int(input())
d={}
for i in range(n):
    command,words=input().split()
    if command=='find':
        if words in d:
            print('yes')
        else:
            print('no')
    else:
        d[words]=0

