def Search(dic, s)
	sn = 0
	en = dic.size-1
	while true
		i = (sn+en)/2
		if dic[i] == s
			return i
		elsif dic[i] < s
			sn = i + 1
		elsif s < dic[i]
			en = i - 1
		end
		return sn if sn > en
		end
	end
end

def Add(dic, s)
	if dic.length == 0
		dic << s
	else
		i = Search(dic, s)
		dic.insert(i, s)
	end
end

def include?(dic, s)
	i = Search(dic, s)
	return true if dic[i] == s
	false
end

dic = Array.new
gets.to_i.times {
	str = gets.chomp.split(" ")
	case str[0]
	when "insert"
		Add(dic, str[1])
	when "find"
		if include?(dic, str[1])
			puts "yes"
		else
			puts "no"
		end
	end
}