n = gets.to_i
moji = { }
n.times do |i|
  command, arr = gets.split(" ")
  if "insert" == command then
    moji[arr] = true
  elsif "find" == command then
    puts moji[arr] ? 'yes' : 'no'
  end
end
    