n = gets.chomp.to_i
list  = Array.new(12).map!{Array.new}
n.times do 
  order = gets.split{" "}
  case order[0]
    when "insert"
    list[order[1].size-1].push order[1].gsub(/A/,"1").gsub(/C/,"2").gsub(/G/,"3").gsub(/T/,"4").to_i
    when "find"
    puts list[order[1].size-1].include?(order[1].gsub(/A/,"1").gsub(/C/,"2").gsub(/G/,"3").gsub(/T/,"4").to_i) ? "yes": "no"
  end
end