N,K = map(int,input().split())
A = list(map(int,input().split()))

count = 0

if N<2:
    if A[0]>=K:
        count+=1

elif N<3:
    if A[0]>=K:
        count+=1
    if A[1]>=K:
        count+=1
    if sum(A)>=K:
        count+=1
else:
    for i in range(N-1):
        s = 0
        for j in range(i,N):
            s += A[j]
            if s >= K:
                count += (N-j)
#                print('!!!',A[i:j+1],sum(A[i:j+1]),count,(N-j))
                break
        
print(str(count))