n, k = gets.chomp.split(' ').map(&:to_i)
nums = gets.chomp.split(' ').map(&:to_i)
sum = 0
index = 0
result = 0

nums.each do |num|
  while sum < k  && index < nums.length do
    sum += nums[index]
    index += 1
  end
  if index == nums.length
    result += 1 if sum >= k
  else
    result += (nums.length + 1 - index)
  end
  sum -= num
end

puts result