class Dictionary

	def initialize
		@table = []
	end

	def insert(e)
		i = 0
		n = e.sum
		loop do
			key = (hashcode(n) + i * hashcode2(n)) % SEED
			unless @table[key]
				@table[key] = e
				return self
			end
			i += 1
		end
	end

	def find(e)
		i = 0
		n = e.sum
		loop do
			key = (hashcode(n) + i * hashcode2(n)) % SEED
			if !@table[key]
				return false
			elsif @table[key] == e
				return true
			end
			i += 1
		end
	end

	private
	SEED = 16777219

	def hashcode(n)
		n % SEED
	end

	def hashcode2(n)
		1 + (n % (SEED - 1))
	end

end

n = STDIN.gets.to_i
dictionary = Dictionary.new
n.times do
	operation, parameter = STDIN.gets.split
	if operation == "insert"
		dictionary.insert(parameter)
	elsif operation == "find"
		found = dictionary.find(parameter)
		puts(found ? "yes" : "no")
	else
		raise "Invalid input: #{operation}, #{parameter}"
	end
end