import sys
n = int(sys.stdin.readline())

dic = {}
for i in range(n):
    s = sys.stdin.readline()
    if s[0] == 'i':
        dic[s[7:]] = 1
    else:
        if s[5:] in dic:
            print('yes')
        else:
            print('no') import sys sys n = int(sys.stdin.readline()) n int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline dic = {} dic {} for i in range(n):
    s = sys.stdin.readline()
    if s[0] == 'i':
        dic[s[7:]] = 1
    else:
        if s[5:] in dic:
            print('yes')
        else:
            print('no') i range(n) range n s = sys.stdin.readline() s sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline if s[0] == 'i':
        dic[s[7:]] = 1
    else:
        if s[5:] in dic:
            print('yes')
        else:
            print('no') s[0] == 'i' s[0] s 0 'i' dic[s[7:]] = 1 dic[s[7:]] dic s[7:] s 7: 7 1 if s[5:] in dic:
            print('yes')
        else:
            print('no') s[5:] in dic s[5:] s 5: 5 dic print('yes') print 'yes' print('no') print 'no' s = sys.stdin.readline() sys.stdin.readline() s n = int(sys.stdin.readline()) int(sys.stdin.readline()) n dic = {} {} dic
import sys
n = int(sys.stdin.readline())

dic = {}
for i in range(n):
    s = sys.stdin.readline()
    if s[0] == 'i':
        dic[s[7:]] = 1
    else:
        if s[5:] in dic:
            print('yes')
        else:
            print('no')
