n = gets.chomp.to_i
h = {}
n.times do 
  a = gets.chomp.split(" ")
  if a[0] == "insert"
    h[a[1]] = 1
  end
  if a[0] == "find"
    if h[a[1]] == 1
      puts "yes"
    else
      puts "no"
    end
  end
end