count = gets.chomp.to_i

insert = []
ans = []

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

puts ans