n = gets.to_i
dic = Hash.new(0)
for i in 0..(n-1)
  order = gets.split(" ")
  if order[0] == "insert"
    dic[order[1]] = 1
  else
    if dic[order[1]] == 1
      puts "yes"
    else
      puts "no"
    end
  end
end