count = gets.chomp.to_i

insert = []
ans = []

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

  val = if insert.include?(temp[1])
    "yes"
  else
    "no"
  end

  ans << val
}

puts ans