import numpy as np

N,S=map(int,input().split())
A=list(map(int,input().split()))
dp=[[0 for i in range(S+1)] for j in range(N+1)]
for i in range(1,N+1):
  for s in range(1,S+1):
    if A[i-1] < s:
      dp[i][s]=dp[i-1][s-A[i-1]] + dp[i-1][s]
    elif A[i-1]==s:
      dp[i][s]=1
    else:
      dp[i][s]=dp[i-1][s]
print(np.array(dp).sum())