dict = {}
n = gets.to_i
answers = []
1.upto(n).each {
  op, x = gets.chomp.split
  case op
    when "insert" then dict[x] = 0
    when "find" then answers << (dict.has_key?(x) ? "yes" : "no")
  end
}

puts answers.join("\n")