import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy


n = int(input())
d = set()
for i in range(n):
    command,s = input().split()
    if command == "insert":
        d.add(s)
    else:
        if s in d:
            print("yes")
        else:
            print("no")
 import sys sys import itertools itertools sys.setrecursionlimit(1000000000) sys.setrecursionlimit sys setrecursionlimit 1000000000 from heapq import heapify,heappop,heappush,heappushpop import math math import collections collections import copy copy n = int(input()) n int(input()) int input() input d = set() d set() set for i in range(n):
    command,s = input().split()
    if command == "insert":
        d.add(s)
    else:
        if s in d:
            print("yes")
        else:
            print("no") i range(n) range n command,s = input().split() command input().split() ().split () input split s if command == "insert":
        d.add(s)
    else:
        if s in d:
            print("yes")
        else:
            print("no") command == "insert" command "insert" d.add(s) d.add d add s if s in d:
            print("yes")
        else:
            print("no") s in d s d print("yes") print "yes" print("no") print "no" command,s = input().split() input().split() command d = set() set() d n = int(input()) int(input()) n s = input().split() input().split() s
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy


n = int(input())
d = set()
for i in range(n):
    command,s = input().split()
    if command == "insert":
        d.add(s)
    else:
        if s in d:
            print("yes")
        else:
            print("no")

