n = gets.to_i
dict = []
(0...n).each { |n|
  op, v = gets.split(' ')
  if op =~ /^insert$/
    dict << v
  elsif op =~ /^find$/
    if dict.include?(v)
      puts "yes"
    else
      puts "no"
    end
  else
    puts "Unknown instruction"
  end
}