n = int(input())
d = {}

while n > 0:
    n -= 1
    c,m = input().split()

    if c == "insert":
        d[m] = 0

    else:
        if m in d:
            print("yes")
        else:
            print("no") n = int(input()) n int(input()) int input() input d = {} d {} while n > 0:
    n -= 1
    c,m = input().split()

    if c == "insert":
        d[m] = 0

    else:
        if m in d:
            print("yes")
        else:
            print("no") n > 0 n 0 n -= 1 n 1 c,m = input().split() c input().split() ().split () input split m if c == "insert":
        d[m] = 0

    else:
        if m in d:
            print("yes")
        else:
            print("no") c == "insert" c "insert" d[m] = 0 d[m] d m 0 if m in d:
            print("yes")
        else:
            print("no") m in d m d print("yes") print "yes" print("no") print "no" n -= 1 1 n d = {} {} d n = int(input()) int(input()) n m = input().split() input().split() m c,m = input().split() input().split() c
n = int(input())
d = {}

while n > 0:
    n -= 1
    c,m = input().split()

    if c == "insert":
        d[m] = 0

    else:
        if m in d:
            print("yes")
        else:
            print("no")
