n = int(raw_input().strip())
commands = []
for i in range(n):
    commands.append(raw_input().strip())


d = [False]*67108870

def hash(s):
    ret = 0
    i = 0
    for dg in s:
        if dg == 'A':
            ret += 0 * 4**i
        elif dg == 'C':
            ret += 1 * 4**i
        elif dg == 'G':
            ret += 2 * 4**i
        elif dg == 'T':
            ret += 3 * 4**i
        i += 1
    return ret

def insert(d,s):
    h = hash(s)
    d[h] = True

def find(d,s):
    h = hash(s)
    if d[h]: print 'yes'
    else: print 'no'

for c in commands:
    c += 'C'
    if c[0] == 'i':
        insert(d,c[7:])
    else:
        find(d,c[5:]) n = int(raw_input().strip()) n int(raw_input().strip()) int raw_input().strip() ().strip () raw_input strip commands = [] commands [] for i in range(n):
    commands.append(raw_input().strip()) i range(n) range n commands.append(raw_input().strip()) commands.append commands append raw_input().strip() ().strip () raw_input strip d = [False]*67108870 d [False]*67108870 [False] False 67108870 def hash(s):
    ret = 0
    i = 0
    for dg in s:
        if dg == 'A':
            ret += 0 * 4**i
        elif dg == 'C':
            ret += 1 * 4**i
        elif dg == 'G':
            ret += 2 * 4**i
        elif dg == 'T':
            ret += 3 * 4**i
        i += 1
    return ret hash ret = 0 ret 0 i = 0 i 0 for dg in s:
        if dg == 'A':
            ret += 0 * 4**i
        elif dg == 'C':
            ret += 1 * 4**i
        elif dg == 'G':
            ret += 2 * 4**i
        elif dg == 'T':
            ret += 3 * 4**i
        i += 1
     dg s if dg == 'A':
            ret += 0 * 4**i
        elif dg == 'C':
            ret += 1 * 4**i
        elif dg == 'G':
            ret += 2 * 4**i
        elif dg == 'T':
            ret += 3 * 4**i
         dg == 'A' dg 'A' ret += 0 * 4**i ret 0 * 4**i 0 4**i 4 i elif dg == 'C':
            ret += 1 * 4**i
         dg == 'C' dg 'C' ret += 1 * 4**i ret 1 * 4**i 1 4**i 4 i elif dg == 'G':
            ret += 2 * 4**i
         dg == 'G' dg 'G' ret += 2 * 4**i ret 2 * 4**i 2 4**i 4 i elif dg == 'T':
            ret += 3 * 4**i
         dg == 'T' dg 'T' ret += 3 * 4**i ret 3 * 4**i 3 4**i 4 i i += 1 i 1 return ret ret s s def insert(d,s):
    h = hash(s)
    d[h] = True insert h = hash(s) h hash(s) hash s d[h] = True d[h] d h True d d s s def find(d,s):
    h = hash(s)
    if d[h]: print 'yes'
    else: print 'no' find h = hash(s) h hash(s) hash s if d[h]: print 'yes'
    else: print 'no' d[h] d h d d s s for c in commands:
    c += 'C'
    if c[0] == 'i':
        insert(d,c[7:])
    else:
        find(d,c[5:]) c commands c += 'C' c 'C' if c[0] == 'i':
        insert(d,c[7:])
    else:
        find(d,c[5:]) c[0] == 'i' c[0] c 0 'i' insert(d,c[7:]) insert d c[7:] c 7: 7 find(d,c[5:]) find d c[5:] c 5: 5 n = int(raw_input().strip()) int(raw_input().strip()) n d = [False]*67108870 [False]*67108870 d commands = [] [] commands def find(d,s):
    h = hash(s)
    if d[h]: print 'yes'
    else: print 'no' def find(d,s):
    h = hash(s)
    if d[h]: print 'yes'
    else: print 'no' find def hash(s):
    ret = 0
    i = 0
    for dg in s:
        if dg == 'A':
            ret += 0 * 4**i
        elif dg == 'C':
            ret += 1 * 4**i
        elif dg == 'G':
            ret += 2 * 4**i
        elif dg == 'T':
            ret += 3 * 4**i
        i += 1
    return ret def hash(s):
    ret = 0
    i = 0
    for dg in s:
        if dg == 'A':
            ret += 0 * 4**i
        elif dg == 'C':
            ret += 1 * 4**i
        elif dg == 'G':
            ret += 2 * 4**i
        elif dg == 'T':
            ret += 3 * 4**i
        i += 1
    return ret hash def insert(d,s):
    h = hash(s)
    d[h] = True def insert(d,s):
    h = hash(s)
    d[h] = True insert c += 'C' 'C' c
n = int(raw_input().strip())
commands = []
for i in range(n):
    commands.append(raw_input().strip())


d = [False]*67108870

def hash(s):
    ret = 0
    i = 0
    for dg in s:
        if dg == 'A':
            ret += 0 * 4**i
        elif dg == 'C':
            ret += 1 * 4**i
        elif dg == 'G':
            ret += 2 * 4**i
        elif dg == 'T':
            ret += 3 * 4**i
        i += 1
    return ret

def insert(d,s):
    h = hash(s)
    d[h] = True

def find(d,s):
    h = hash(s)
    if d[h]: print 'yes'
    else: print 'no'

for c in commands:
    c += 'C'
    if c[0] == 'i':
        insert(d,c[7:])
    else:
        find(d,c[5:])