count = gets.chomp.to_i

insert = []
ans = []
memo = []

count.times {
  temp = gets.chomp.split(" ")
  if temp[0] == "insert"
    insert << temp[1]
  else
    val = if memo.uniq.include?(temp[1])
      memo << temp[1]
      "yes"
    elsif insert.include?(temp[1])
      "yes"
    else
      "no"
    end
    ans << val
  end
}

puts ans