H = []

gets.to_i.times do
  input = gets.split(" ")
  if input[0] == "insert"
    H[input[1].tr("ACGT", "1234").to_i(5)] = 1
  else
    if H[input[1].tr("ACGT", "1234").to_i(5)] == 1
      puts "yes"
    else
      puts "no"
    end
  end
end

