n = int(input())
length = 1000018
sosu = 500009
ht = [-1] * length


def convert(moji):
    l_moji = len(moji)
    num = 0
    for j in range(l_moji):
        keta = 10 ** (l_moji - j - 1)
        if moji[j] == 'A':
            num += keta * 1
        if moji[j] == 'C':
            num += keta * 2
        if moji[j] == 'G':
            num += keta * 3
        if moji[j] == 'T':
            num += keta * 4
    return num


def hash_in(nk, num, m):
    if m == 0:
        return False
    hash_num = nk + (num % m)
    if hash_num > length:
        hash_num -= length
    if ht[hash_num] == -1:
        ht[hash_num] = num
    elif ht[hash_num] != num:
        hash_in(hash_num, num, m-1)
    return


def find(nk, num, m):
    if m == 0:
        return 'no'
    hash_num = nk + (num % m)
    if hash_num > length:
        hash_num -= length
    if ht[hash_num] == -1:
        return 'no'
    elif ht[hash_num] != num:
        return find(hash_num, num, m-1)
    elif ht[hash_num] == num:
        return 'yes'


def main():
    output = list()
    for i in range(n):
        command = list(input().split())
        num = convert(command[1])
        if command[0] == 'insert':
            if hash_in(0, num, sosu) is not None:
                print('an error is occured')
                break
        if command[0] == 'find':
            output.append(find(0, num, sosu))

    for j in output:
        print(j)


if __name__ == '__main__':
    main()
 n = int(input()) n int(input()) int input() input length = 1000018 length 1000018 sosu = 500009 sosu 500009 ht = [-1] * length ht [-1] * length [-1] -1 length def convert(moji):
    l_moji = len(moji)
    num = 0
    for j in range(l_moji):
        keta = 10 ** (l_moji - j - 1)
        if moji[j] == 'A':
            num += keta * 1
        if moji[j] == 'C':
            num += keta * 2
        if moji[j] == 'G':
            num += keta * 3
        if moji[j] == 'T':
            num += keta * 4
    return num convert l_moji = len(moji) l_moji len(moji) len moji num = 0 num 0 for j in range(l_moji):
        keta = 10 ** (l_moji - j - 1)
        if moji[j] == 'A':
            num += keta * 1
        if moji[j] == 'C':
            num += keta * 2
        if moji[j] == 'G':
            num += keta * 3
        if moji[j] == 'T':
            num += keta * 4
     j range(l_moji) range l_moji keta = 10 ** (l_moji - j - 1) keta 10 ** (l_moji - j - 1) 10 l_moji - j - 1 l_moji - j l_moji j 1 if moji[j] == 'A':
            num += keta * 1
         moji[j] == 'A' moji[j] moji j 'A' num += keta * 1 num keta * 1 keta 1 if moji[j] == 'C':
            num += keta * 2
         moji[j] == 'C' moji[j] moji j 'C' num += keta * 2 num keta * 2 keta 2 if moji[j] == 'G':
            num += keta * 3
         moji[j] == 'G' moji[j] moji j 'G' num += keta * 3 num keta * 3 keta 3 if moji[j] == 'T':
            num += keta * 4
     moji[j] == 'T' moji[j] moji j 'T' num += keta * 4 num keta * 4 keta 4 return num num moji moji def hash_in(nk, num, m):
    if m == 0:
        return False
    hash_num = nk + (num % m)
    if hash_num > length:
        hash_num -= length
    if ht[hash_num] == -1:
        ht[hash_num] = num
    elif ht[hash_num] != num:
        hash_in(hash_num, num, m-1)
    return hash_in if m == 0:
        return False
     m == 0 m 0 return False False hash_num = nk + (num % m) hash_num nk + (num % m) nk num % m num m if hash_num > length:
        hash_num -= length
     hash_num > length hash_num length hash_num -= length hash_num length if ht[hash_num] == -1:
        ht[hash_num] = num
    elif ht[hash_num] != num:
        hash_in(hash_num, num, m-1)
     ht[hash_num] == -1 ht[hash_num] ht hash_num -1 ht[hash_num] = num ht[hash_num] ht hash_num num elif ht[hash_num] != num:
        hash_in(hash_num, num, m-1)
     ht[hash_num] != num ht[hash_num] ht hash_num num hash_in(hash_num, num, m-1) hash_in hash_num num m-1 m 1 return nk nk num num m m def find(nk, num, m):
    if m == 0:
        return 'no'
    hash_num = nk + (num % m)
    if hash_num > length:
        hash_num -= length
    if ht[hash_num] == -1:
        return 'no'
    elif ht[hash_num] != num:
        return find(hash_num, num, m-1)
    elif ht[hash_num] == num:
        return 'yes' find if m == 0:
        return 'no'
     m == 0 m 0 return 'no' 'no' hash_num = nk + (num % m) hash_num nk + (num % m) nk num % m num m if hash_num > length:
        hash_num -= length
     hash_num > length hash_num length hash_num -= length hash_num length if ht[hash_num] == -1:
        return 'no'
    elif ht[hash_num] != num:
        return find(hash_num, num, m-1)
    elif ht[hash_num] == num:
        return 'yes' ht[hash_num] == -1 ht[hash_num] ht hash_num -1 return 'no' 'no' elif ht[hash_num] != num:
        return find(hash_num, num, m-1)
     ht[hash_num] != num ht[hash_num] ht hash_num num return find(hash_num, num, m-1) find(hash_num, num, m-1) find hash_num num m-1 m 1 elif ht[hash_num] == num:
        return 'yes' ht[hash_num] == num ht[hash_num] ht hash_num num return 'yes' 'yes' nk nk num num m m def main():
    output = list()
    for i in range(n):
        command = list(input().split())
        num = convert(command[1])
        if command[0] == 'insert':
            if hash_in(0, num, sosu) is not None:
                print('an error is occured')
                break
        if command[0] == 'find':
            output.append(find(0, num, sosu))

    for j in output:
        print(j) main output = list() output list() list for i in range(n):
        command = list(input().split())
        num = convert(command[1])
        if command[0] == 'insert':
            if hash_in(0, num, sosu) is not None:
                print('an error is occured')
                break
        if command[0] == 'find':
            output.append(find(0, num, sosu))

     i range(n) range n command = list(input().split()) command list(input().split()) list input().split() ().split () input split num = convert(command[1]) num convert(command[1]) convert command[1] command 1 if command[0] == 'insert':
            if hash_in(0, num, sosu) is not None:
                print('an error is occured')
                break
         command[0] == 'insert' command[0] command 0 'insert' if hash_in(0, num, sosu) is not None:
                print('an error is occured')
                break
         hash_in(0, num, sosu) is not None hash_in(0, num, sosu) hash_in 0 num sosu None print('an error is occured') print 'an error is occured' break if command[0] == 'find':
            output.append(find(0, num, sosu))

     command[0] == 'find' command[0] command 0 'find' output.append(find(0, num, sosu)) output.append output append find(0, num, sosu) find 0 num sosu for j in output:
        print(j) j output print(j) print j if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def hash_in(nk, num, m):
    if m == 0:
        return False
    hash_num = nk + (num % m)
    if hash_num > length:
        hash_num -= length
    if ht[hash_num] == -1:
        ht[hash_num] = num
    elif ht[hash_num] != num:
        hash_in(hash_num, num, m-1)
    return def hash_in(nk, num, m):
    if m == 0:
        return False
    hash_num = nk + (num % m)
    if hash_num > length:
        hash_num -= length
    if ht[hash_num] == -1:
        ht[hash_num] = num
    elif ht[hash_num] != num:
        hash_in(hash_num, num, m-1)
    return hash_in def main():
    output = list()
    for i in range(n):
        command = list(input().split())
        num = convert(command[1])
        if command[0] == 'insert':
            if hash_in(0, num, sosu) is not None:
                print('an error is occured')
                break
        if command[0] == 'find':
            output.append(find(0, num, sosu))

    for j in output:
        print(j) def main():
    output = list()
    for i in range(n):
        command = list(input().split())
        num = convert(command[1])
        if command[0] == 'insert':
            if hash_in(0, num, sosu) is not None:
                print('an error is occured')
                break
        if command[0] == 'find':
            output.append(find(0, num, sosu))

    for j in output:
        print(j) main n = int(input()) int(input()) n ht = [-1] * length [-1] * length ht def find(nk, num, m):
    if m == 0:
        return 'no'
    hash_num = nk + (num % m)
    if hash_num > length:
        hash_num -= length
    if ht[hash_num] == -1:
        return 'no'
    elif ht[hash_num] != num:
        return find(hash_num, num, m-1)
    elif ht[hash_num] == num:
        return 'yes' def find(nk, num, m):
    if m == 0:
        return 'no'
    hash_num = nk + (num % m)
    if hash_num > length:
        hash_num -= length
    if ht[hash_num] == -1:
        return 'no'
    elif ht[hash_num] != num:
        return find(hash_num, num, m-1)
    elif ht[hash_num] == num:
        return 'yes' find sosu = 500009 500009 sosu def convert(moji):
    l_moji = len(moji)
    num = 0
    for j in range(l_moji):
        keta = 10 ** (l_moji - j - 1)
        if moji[j] == 'A':
            num += keta * 1
        if moji[j] == 'C':
            num += keta * 2
        if moji[j] == 'G':
            num += keta * 3
        if moji[j] == 'T':
            num += keta * 4
    return num def convert(moji):
    l_moji = len(moji)
    num = 0
    for j in range(l_moji):
        keta = 10 ** (l_moji - j - 1)
        if moji[j] == 'A':
            num += keta * 1
        if moji[j] == 'C':
            num += keta * 2
        if moji[j] == 'G':
            num += keta * 3
        if moji[j] == 'T':
            num += keta * 4
    return num convert length = 1000018 1000018 length
n = int(input())
length = 1000018
sosu = 500009
ht = [-1] * length


def convert(moji):
    l_moji = len(moji)
    num = 0
    for j in range(l_moji):
        keta = 10 ** (l_moji - j - 1)
        if moji[j] == 'A':
            num += keta * 1
        if moji[j] == 'C':
            num += keta * 2
        if moji[j] == 'G':
            num += keta * 3
        if moji[j] == 'T':
            num += keta * 4
    return num


def hash_in(nk, num, m):
    if m == 0:
        return False
    hash_num = nk + (num % m)
    if hash_num > length:
        hash_num -= length
    if ht[hash_num] == -1:
        ht[hash_num] = num
    elif ht[hash_num] != num:
        hash_in(hash_num, num, m-1)
    return


def find(nk, num, m):
    if m == 0:
        return 'no'
    hash_num = nk + (num % m)
    if hash_num > length:
        hash_num -= length
    if ht[hash_num] == -1:
        return 'no'
    elif ht[hash_num] != num:
        return find(hash_num, num, m-1)
    elif ht[hash_num] == num:
        return 'yes'


def main():
    output = list()
    for i in range(n):
        command = list(input().split())
        num = convert(command[1])
        if command[0] == 'insert':
            if hash_in(0, num, sosu) is not None:
                print('an error is occured')
                break
        if command[0] == 'find':
            output.append(find(0, num, sosu))

    for j in output:
        print(j)


if __name__ == '__main__':
    main()

