
class Func
	def initialize()
		@list = []
	end
def insert(str)
  @list << str
end

def find(str)
	if @list.include?(str)
		return "yes"
	else
		return "no"
	end
end
end

n = gets.to_i
f = Func.new
ans = []
n.times do
	command,str = gets.split.map(&:to_s)
	if command == "insert"
		f.insert(str)
	else
		ans << f.find(str)
	end
end

ans.each do |s|
	puts s
end