
import sys
from sys import stdin
input = stdin.readline

n = int(input())
D = {}
for i in range(n):
    s = input()
    if s[0] == "i":
        D[s[7:]] = 11111111111111111111111111111111111
    else:
        print("yes" if s[5:] in D else "no")
 import sys sys from sys import stdin input = stdin.readline input stdin.readline stdin readline n = int(input()) n int(input()) int input() input D = {} D {} for i in range(n):
    s = input()
    if s[0] == "i":
        D[s[7:]] = 11111111111111111111111111111111111
    else:
        print("yes" if s[5:] in D else "no") i range(n) range n s = input() s input() input if s[0] == "i":
        D[s[7:]] = 11111111111111111111111111111111111
    else:
        print("yes" if s[5:] in D else "no") s[0] == "i" s[0] s 0 "i" D[s[7:]] = 11111111111111111111111111111111111 D[s[7:]] D s[7:] s 7: 7 11111111111111111111111111111111111 print("yes" if s[5:] in D else "no") print "yes" if s[5:] in D else "no" s[5:] in D s[5:] s 5: 5 D "yes" "no" input = stdin.readline stdin.readline input D = {} {} D s = input() input() s n = int(input()) int(input()) n

import sys
from sys import stdin
input = stdin.readline

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

