from sys import stdin
import sys
input = stdin.readline

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

dic = {}
n = int(input())
for i in range(n):
    s = input()
    if s[0] == 'i':
        dic[s[7:]] = 1
    else:
        print("yes" if s[5:] in dic else "no")

