def get_char_value(char):
    if char == "C":
        return 1;
    if char == "A":
        return 2;
    if char == "G":
        return 3;
    if char == "T":
        return 4;

def get_string_value(string):
    s = 0;
    p = 1;
    for char in string:
        s += p * get_char_value(char);
        p *= 5;
    return s;

def h1(value, M):
    return value % M;

def h2(value, M):
    return 1 + value % (M - 1);

def insert(dic, M, string):
    value = get_string_value(string);
    h1_value = h1(value, M);
    h2_value = h2(value, M);
    i = 0;
    while True:
        index = (h1_value + i * h2_value) % M;
        if dic[index] == string:
            break;
        elif dic[index] is None:
            dic[index] = string;
            break;
        i += 1;

def find(dic, M, string):
    value = get_string_value(string);
    h1_value = h1(value, M);
    h2_value = h2(value, M);
    i = 0;
    while True:
        index = (h1_value + i * h2_value) % M;
        if dic[index] == string:
            return True;
        elif dic[index] is None:
            return False;
        i += 1;

M = 1046527;
dic = [None for i in range(M)];
count = int(input());
for i in range(count):
    command = input().split();
    if command[0] == "insert":
        insert(dic, M, command[1]);
    elif command[0] == "find":
        if find(dic, M, command[1]):
            print("yes");
        else:
            print("no");

 def get_char_value(char):
    if char == "C":
        return 1;
    if char == "A":
        return 2;
    if char == "G":
        return 3;
    if char == "T":
        return 4; get_char_value if char == "C":
        return 1;
     char == "C" char "C" return 1 1 if char == "A":
        return 2;
     char == "A" char "A" return 2 2 if char == "G":
        return 3;
     char == "G" char "G" return 3 3 if char == "T":
        return 4; char == "T" char "T" return 4 4 char char def get_string_value(string):
    s = 0;
    p = 1;
    for char in string:
        s += p * get_char_value(char);
        p *= 5;
    return s; get_string_value s = 0 s 0 p = 1 p 1 for char in string:
        s += p * get_char_value(char);
        p *= 5;
     char string s += p * get_char_value(char) s p * get_char_value(char) p get_char_value(char) get_char_value char p *= 5 p 5 return s s string string def h1(value, M):
    return value % M; h1 return value % M value % M value M value value M M def h2(value, M):
    return 1 + value % (M - 1); h2 return 1 + value % (M - 1) 1 + value % (M - 1) 1 value % (M - 1) value M - 1 M 1 value value M M def insert(dic, M, string):
    value = get_string_value(string);
    h1_value = h1(value, M);
    h2_value = h2(value, M);
    i = 0;
    while True:
        index = (h1_value + i * h2_value) % M;
        if dic[index] == string:
            break;
        elif dic[index] is None:
            dic[index] = string;
            break;
        i += 1; insert value = get_string_value(string) value get_string_value(string) get_string_value string h1_value = h1(value, M) h1_value h1(value, M) h1 value M h2_value = h2(value, M) h2_value h2(value, M) h2 value M i = 0 i 0 while True:
        index = (h1_value + i * h2_value) % M;
        if dic[index] == string:
            break;
        elif dic[index] is None:
            dic[index] = string;
            break;
        i += 1; True index = (h1_value + i * h2_value) % M index (h1_value + i * h2_value) % M h1_value + i * h2_value h1_value i * h2_value i h2_value M if dic[index] == string:
            break;
        elif dic[index] is None:
            dic[index] = string;
            break;
         dic[index] == string dic[index] dic index string break elif dic[index] is None:
            dic[index] = string;
            break;
         dic[index] is None dic[index] dic index None dic[index] = string dic[index] dic index string break i += 1 i 1 dic dic M M string string def find(dic, M, string):
    value = get_string_value(string);
    h1_value = h1(value, M);
    h2_value = h2(value, M);
    i = 0;
    while True:
        index = (h1_value + i * h2_value) % M;
        if dic[index] == string:
            return True;
        elif dic[index] is None:
            return False;
        i += 1; find value = get_string_value(string) value get_string_value(string) get_string_value string h1_value = h1(value, M) h1_value h1(value, M) h1 value M h2_value = h2(value, M) h2_value h2(value, M) h2 value M i = 0 i 0 while True:
        index = (h1_value + i * h2_value) % M;
        if dic[index] == string:
            return True;
        elif dic[index] is None:
            return False;
        i += 1; True index = (h1_value + i * h2_value) % M index (h1_value + i * h2_value) % M h1_value + i * h2_value h1_value i * h2_value i h2_value M if dic[index] == string:
            return True;
        elif dic[index] is None:
            return False;
         dic[index] == string dic[index] dic index string return True True elif dic[index] is None:
            return False;
         dic[index] is None dic[index] dic index None return False False i += 1 i 1 dic dic M M string string M = 1046527 M 1046527 None for i in range(M) for i in range(M) i range(M) range M for i in range(M) None dic = [None for i in range(M)] dic [None for i in range(M)] count = int(input()) count int(input()) int input() input for i in range(count):
    command = input().split();
    if command[0] == "insert":
        insert(dic, M, command[1]);
    elif command[0] == "find":
        if find(dic, M, command[1]):
            print("yes");
        else:
            print("no"); i range(count) range count command = input().split() command input().split() ().split () input split if command[0] == "insert":
        insert(dic, M, command[1]);
    elif command[0] == "find":
        if find(dic, M, command[1]):
            print("yes");
        else:
            print("no"); command[0] == "insert" command[0] command 0 "insert" insert(dic, M, command[1]) insert dic M command[1] command 1 elif command[0] == "find":
        if find(dic, M, command[1]):
            print("yes");
        else:
            print("no"); command[0] == "find" command[0] command 0 "find" if find(dic, M, command[1]):
            print("yes");
        else:
            print("no"); find(dic, M, command[1]) find dic M command[1] command 1 print("yes") print "yes" print("no") print "no" def get_string_value(string):
    s = 0;
    p = 1;
    for char in string:
        s += p * get_char_value(char);
        p *= 5;
    return s; def get_string_value(string):
    s = 0;
    p = 1;
    for char in string:
        s += p * get_char_value(char);
        p *= 5;
    return s; get_string_value M = 1046527 1046527 M def insert(dic, M, string):
    value = get_string_value(string);
    h1_value = h1(value, M);
    h2_value = h2(value, M);
    i = 0;
    while True:
        index = (h1_value + i * h2_value) % M;
        if dic[index] == string:
            break;
        elif dic[index] is None:
            dic[index] = string;
            break;
        i += 1; def insert(dic, M, string):
    value = get_string_value(string);
    h1_value = h1(value, M);
    h2_value = h2(value, M);
    i = 0;
    while True:
        index = (h1_value + i * h2_value) % M;
        if dic[index] == string:
            break;
        elif dic[index] is None:
            dic[index] = string;
            break;
        i += 1; insert command = input().split() input().split() command count = int(input()) int(input()) count def get_char_value(char):
    if char == "C":
        return 1;
    if char == "A":
        return 2;
    if char == "G":
        return 3;
    if char == "T":
        return 4; def get_char_value(char):
    if char == "C":
        return 1;
    if char == "A":
        return 2;
    if char == "G":
        return 3;
    if char == "T":
        return 4; get_char_value def h2(value, M):
    return 1 + value % (M - 1); def h2(value, M):
    return 1 + value % (M - 1); h2 def find(dic, M, string):
    value = get_string_value(string);
    h1_value = h1(value, M);
    h2_value = h2(value, M);
    i = 0;
    while True:
        index = (h1_value + i * h2_value) % M;
        if dic[index] == string:
            return True;
        elif dic[index] is None:
            return False;
        i += 1; def find(dic, M, string):
    value = get_string_value(string);
    h1_value = h1(value, M);
    h2_value = h2(value, M);
    i = 0;
    while True:
        index = (h1_value + i * h2_value) % M;
        if dic[index] == string:
            return True;
        elif dic[index] is None:
            return False;
        i += 1; find dic = [None for i in range(M)] [None for i in range(M)] dic def h1(value, M):
    return value % M; def h1(value, M):
    return value % M; h1
def get_char_value(char):
    if char == "C":
        return 1;
    if char == "A":
        return 2;
    if char == "G":
        return 3;
    if char == "T":
        return 4;

def get_string_value(string):
    s = 0;
    p = 1;
    for char in string:
        s += p * get_char_value(char);
        p *= 5;
    return s;

def h1(value, M):
    return value % M;

def h2(value, M):
    return 1 + value % (M - 1);

def insert(dic, M, string):
    value = get_string_value(string);
    h1_value = h1(value, M);
    h2_value = h2(value, M);
    i = 0;
    while True:
        index = (h1_value + i * h2_value) % M;
        if dic[index] == string:
            break;
        elif dic[index] is None:
            dic[index] = string;
            break;
        i += 1;

def find(dic, M, string):
    value = get_string_value(string);
    h1_value = h1(value, M);
    h2_value = h2(value, M);
    i = 0;
    while True:
        index = (h1_value + i * h2_value) % M;
        if dic[index] == string:
            return True;
        elif dic[index] is None:
            return False;
        i += 1;

M = 1046527;
dic = [None for i in range(M)];
count = int(input());
for i in range(count):
    command = input().split();
    if command[0] == "insert":
        insert(dic, M, command[1]);
    elif command[0] == "find":
        if find(dic, M, command[1]):
            print("yes");
        else:
            print("no");


