import sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**10
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    n = I()
    Q = [LSS() for _ in range(n)]

    d = set()

    for i, j in Q:
        if i=='insert':
            d.add(j)
        else:
            if j in d:
                print('yes')
            else:
                print('no')

if __name__ == '__main__':
    resolve() import sys sys input = lambda: sys.stdin.readline().rstrip() input lambda: sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip sys.setrecursionlimit(10**7) sys.setrecursionlimit sys setrecursionlimit 10**7 10 7 INF = 10**10 INF 10**10 10 10 def I(): return int(input()) I def F(): return float(input()) F def SS(): return input() SS int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x def LI(): return [int(x) for x in input().split()] LI int(x)-1 for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x)-1 int(x) int x 1 def LI_(): return [int(x)-1 for x in input().split()] LI_ float(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() float(x) float x def LF(): return [float(x) for x in input().split()] LF def LSS(): return input().split() LSS def resolve():
    n = I()
    Q = [LSS() for _ in range(n)]

    d = set()

    for i, j in Q:
        if i=='insert':
            d.add(j)
        else:
            if j in d:
                print('yes')
            else:
                print('no') resolve n = I() n I() I LSS() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) LSS() LSS Q = [LSS() for _ in range(n)] Q [LSS() for _ in range(n)] d = set() d set() set for i, j in Q:
        if i=='insert':
            d.add(j)
        else:
            if j in d:
                print('yes')
            else:
                print('no') i j Q if i=='insert':
            d.add(j)
        else:
            if j in d:
                print('yes')
            else:
                print('no') i=='insert' i 'insert' d.add(j) d.add d add j if j in d:
                print('yes')
            else:
                print('no') j in d j d print('yes') print 'yes' print('no') print 'no' if __name__ == '__main__':
    resolve() __name__ == '__main__' __name__ '__main__' resolve() resolve def I(): return int(input()) def I(): return int(input()) I def LI_(): return [int(x)-1 for x in input().split()] def LI_(): return [int(x)-1 for x in input().split()] LI_ def LI(): return [int(x) for x in input().split()] def LI(): return [int(x) for x in input().split()] LI def resolve():
    n = I()
    Q = [LSS() for _ in range(n)]

    d = set()

    for i, j in Q:
        if i=='insert':
            d.add(j)
        else:
            if j in d:
                print('yes')
            else:
                print('no') def resolve():
    n = I()
    Q = [LSS() for _ in range(n)]

    d = set()

    for i, j in Q:
        if i=='insert':
            d.add(j)
        else:
            if j in d:
                print('yes')
            else:
                print('no') resolve def F(): return float(input()) def F(): return float(input()) F input = lambda: sys.stdin.readline().rstrip() lambda: sys.stdin.readline().rstrip() input def SS(): return input() def SS(): return input() SS def LF(): return [float(x) for x in input().split()] def LF(): return [float(x) for x in input().split()] LF INF = 10**10 10**10 INF def LSS(): return input().split() def LSS(): return input().split() LSS
import sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**10
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    n = I()
    Q = [LSS() for _ in range(n)]

    d = set()

    for i, j in Q:
        if i=='insert':
            d.add(j)
        else:
            if j in d:
                print('yes')
            else:
                print('no')

if __name__ == '__main__':
    resolve()
