count = gets.chomp.to_i

insert = {}
ans = []

count.times {
  temp = gets.chomp.split(" ")
  if temp[0] == "insert"
    insert[temp[1]] = 0
    next
  end

  if insert.has_key?(temp[1])
    ans << "yes"
  else
    ans << "no"
  end
}

puts ans