import sys

n = int(input())
dic = set()
for i in range(n):
    s = sys.stdin.readline()
    if s[0] == "i":
        dic.add(s[7:])
    else:
        print('yes' if s[5:] in dic else 'no') import sys sys n = int(input()) n int(input()) int input() input dic = set() dic set() set for i in range(n):
    s = sys.stdin.readline()
    if s[0] == "i":
        dic.add(s[7:])
    else:
        print('yes' if s[5:] in dic else '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.add(s[7:])
    else:
        print('yes' if s[5:] in dic else 'no') s[0] == "i" s[0] s 0 "i" dic.add(s[7:]) dic.add dic add s[7:] s 7: 7 print('yes' if s[5:] in dic else 'no') print 'yes' if s[5:] in dic else 'no' s[5:] in dic s[5:] s 5: 5 dic 'yes' 'no' dic = set() set() dic n = int(input()) int(input()) n s = sys.stdin.readline() sys.stdin.readline() s
import sys

n = int(input())
dic = set()
for i in range(n):
    s = sys.stdin.readline()
    if s[0] == "i":
        dic.add(s[7:])
    else:
        print('yes' if s[5:] in dic else 'no')