M = 1046527
L = 14
H = [""] * M

def getChar(ch):
    if ch == 'A':
        return 1
    elif ch == 'C':
        return 2
    elif ch == 'G':
        return 3
    elif ch == 'T':
        return 4
    else:
        return 0

def getKey(strings):
    Sum = 0
    p = 1
    for i in xrange(len(strings)):
        Sum += p * getChar(strings[i])
        p *= 5

    return Sum

def h1(key):
    return key % M

def h2(key):
    return 1 + (key % (M-1))

def find(strings):
    key = getKey(strings)
    i = 0
    while True:
        h = (h1(key) + i * h2(key)) % M
        if H[h] == strings:
            return 1
        elif len(H[h]) == 0:
            return 0
        else:
            i += 1
    return 0

def insert(strings):
    key = getKey(strings)
    i = 0
    while True:
        h = (h1(key) + i * h2(key)) % M
        if H[h] == strings:
            return 1
        elif len(H[h]) == 0:
            H[h] = strings
            return 0
        else:
            i += 1
    return 0

def main():
    n = input()
    for i in xrange(n):
        com = raw_input().split()
        if com[0][0] == 'i':
            insert(com[1])
        else:
            if find(com[1]):
                print 'yes'
            else:
                print 'no'
    return 0

main() M = 1046527 M 1046527 L = 14 L 14 H = [""] * M H [""] * M [""] "" M def getChar(ch):
    if ch == 'A':
        return 1
    elif ch == 'C':
        return 2
    elif ch == 'G':
        return 3
    elif ch == 'T':
        return 4
    else:
        return 0 getChar if ch == 'A':
        return 1
    elif ch == 'C':
        return 2
    elif ch == 'G':
        return 3
    elif ch == 'T':
        return 4
    else:
        return 0 ch == 'A' ch 'A' return 1 1 elif ch == 'C':
        return 2
     ch == 'C' ch 'C' return 2 2 elif ch == 'G':
        return 3
     ch == 'G' ch 'G' return 3 3 elif ch == 'T':
        return 4
     ch == 'T' ch 'T' return 4 4 return 0 0 ch ch def getKey(strings):
    Sum = 0
    p = 1
    for i in xrange(len(strings)):
        Sum += p * getChar(strings[i])
        p *= 5

    return Sum getKey Sum = 0 Sum 0 p = 1 p 1 for i in xrange(len(strings)):
        Sum += p * getChar(strings[i])
        p *= 5

     i xrange(len(strings)) xrange len(strings) len strings Sum += p * getChar(strings[i]) Sum p * getChar(strings[i]) p getChar(strings[i]) getChar strings[i] strings i p *= 5 p 5 return Sum Sum strings strings def h1(key):
    return key % M h1 return key % M key % M key M key key def h2(key):
    return 1 + (key % (M-1)) h2 return 1 + (key % (M-1)) 1 + (key % (M-1)) 1 key % (M-1) key M-1 M 1 key key def find(strings):
    key = getKey(strings)
    i = 0
    while True:
        h = (h1(key) + i * h2(key)) % M
        if H[h] == strings:
            return 1
        elif len(H[h]) == 0:
            return 0
        else:
            i += 1
    return 0 find key = getKey(strings) key getKey(strings) getKey strings i = 0 i 0 while True:
        h = (h1(key) + i * h2(key)) % M
        if H[h] == strings:
            return 1
        elif len(H[h]) == 0:
            return 0
        else:
            i += 1
     True h = (h1(key) + i * h2(key)) % M h (h1(key) + i * h2(key)) % M h1(key) + i * h2(key) h1(key) h1 key i * h2(key) i h2(key) h2 key M if H[h] == strings:
            return 1
        elif len(H[h]) == 0:
            return 0
        else:
            i += 1
     H[h] == strings H[h] H h strings return 1 1 elif len(H[h]) == 0:
            return 0
         len(H[h]) == 0 len(H[h]) len H[h] H h 0 return 0 0 i += 1 i 1 return 0 0 strings strings def insert(strings):
    key = getKey(strings)
    i = 0
    while True:
        h = (h1(key) + i * h2(key)) % M
        if H[h] == strings:
            return 1
        elif len(H[h]) == 0:
            H[h] = strings
            return 0
        else:
            i += 1
    return 0 insert key = getKey(strings) key getKey(strings) getKey strings i = 0 i 0 while True:
        h = (h1(key) + i * h2(key)) % M
        if H[h] == strings:
            return 1
        elif len(H[h]) == 0:
            H[h] = strings
            return 0
        else:
            i += 1
     True h = (h1(key) + i * h2(key)) % M h (h1(key) + i * h2(key)) % M h1(key) + i * h2(key) h1(key) h1 key i * h2(key) i h2(key) h2 key M if H[h] == strings:
            return 1
        elif len(H[h]) == 0:
            H[h] = strings
            return 0
        else:
            i += 1
     H[h] == strings H[h] H h strings return 1 1 elif len(H[h]) == 0:
            H[h] = strings
            return 0
         len(H[h]) == 0 len(H[h]) len H[h] H h 0 H[h] = strings H[h] H h strings return 0 0 i += 1 i 1 return 0 0 strings strings def main():
    n = input()
    for i in xrange(n):
        com = raw_input().split()
        if com[0][0] == 'i':
            insert(com[1])
        else:
            if find(com[1]):
                print 'yes'
            else:
                print 'no'
    return 0 main n = input() n input() input for i in xrange(n):
        com = raw_input().split()
        if com[0][0] == 'i':
            insert(com[1])
        else:
            if find(com[1]):
                print 'yes'
            else:
                print 'no'
     i xrange(n) xrange n com = raw_input().split() com raw_input().split() ().split () raw_input split if com[0][0] == 'i':
            insert(com[1])
        else:
            if find(com[1]):
                print 'yes'
            else:
                print 'no'
     com[0][0] == 'i' com[0][0] [0] com 0 0 'i' insert(com[1]) insert com[1] com 1 if find(com[1]):
                print 'yes'
            else:
                print 'no'
     find(com[1]) find com[1] com 1 print print return 0 0 main() main def getChar(ch):
    if ch == 'A':
        return 1
    elif ch == 'C':
        return 2
    elif ch == 'G':
        return 3
    elif ch == 'T':
        return 4
    else:
        return 0 def getChar(ch):
    if ch == 'A':
        return 1
    elif ch == 'C':
        return 2
    elif ch == 'G':
        return 3
    elif ch == 'T':
        return 4
    else:
        return 0 getChar def find(strings):
    key = getKey(strings)
    i = 0
    while True:
        h = (h1(key) + i * h2(key)) % M
        if H[h] == strings:
            return 1
        elif len(H[h]) == 0:
            return 0
        else:
            i += 1
    return 0 def find(strings):
    key = getKey(strings)
    i = 0
    while True:
        h = (h1(key) + i * h2(key)) % M
        if H[h] == strings:
            return 1
        elif len(H[h]) == 0:
            return 0
        else:
            i += 1
    return 0 find def h1(key):
    return key % M def h1(key):
    return key % M h1 M = 1046527 1046527 M def main():
    n = input()
    for i in xrange(n):
        com = raw_input().split()
        if com[0][0] == 'i':
            insert(com[1])
        else:
            if find(com[1]):
                print 'yes'
            else:
                print 'no'
    return 0 def main():
    n = input()
    for i in xrange(n):
        com = raw_input().split()
        if com[0][0] == 'i':
            insert(com[1])
        else:
            if find(com[1]):
                print 'yes'
            else:
                print 'no'
    return 0 main def getKey(strings):
    Sum = 0
    p = 1
    for i in xrange(len(strings)):
        Sum += p * getChar(strings[i])
        p *= 5

    return Sum def getKey(strings):
    Sum = 0
    p = 1
    for i in xrange(len(strings)):
        Sum += p * getChar(strings[i])
        p *= 5

    return Sum getKey H = [""] * M [""] * M H def h2(key):
    return 1 + (key % (M-1)) def h2(key):
    return 1 + (key % (M-1)) h2 L = 14 14 L def insert(strings):
    key = getKey(strings)
    i = 0
    while True:
        h = (h1(key) + i * h2(key)) % M
        if H[h] == strings:
            return 1
        elif len(H[h]) == 0:
            H[h] = strings
            return 0
        else:
            i += 1
    return 0 def insert(strings):
    key = getKey(strings)
    i = 0
    while True:
        h = (h1(key) + i * h2(key)) % M
        if H[h] == strings:
            return 1
        elif len(H[h]) == 0:
            H[h] = strings
            return 0
        else:
            i += 1
    return 0 insert
M = 1046527
L = 14
H = [""] * M

def getChar(ch):
    if ch == 'A':
        return 1
    elif ch == 'C':
        return 2
    elif ch == 'G':
        return 3
    elif ch == 'T':
        return 4
    else:
        return 0

def getKey(strings):
    Sum = 0
    p = 1
    for i in xrange(len(strings)):
        Sum += p * getChar(strings[i])
        p *= 5

    return Sum

def h1(key):
    return key % M

def h2(key):
    return 1 + (key % (M-1))

def find(strings):
    key = getKey(strings)
    i = 0
    while True:
        h = (h1(key) + i * h2(key)) % M
        if H[h] == strings:
            return 1
        elif len(H[h]) == 0:
            return 0
        else:
            i += 1
    return 0

def insert(strings):
    key = getKey(strings)
    i = 0
    while True:
        h = (h1(key) + i * h2(key)) % M
        if H[h] == strings:
            return 1
        elif len(H[h]) == 0:
            H[h] = strings
            return 0
        else:
            i += 1
    return 0

def main():
    n = input()
    for i in xrange(n):
        com = raw_input().split()
        if com[0][0] == 'i':
            insert(com[1])
        else:
            if find(com[1]):
                print 'yes'
            else:
                print 'no'
    return 0

main()