n, s = map(int, input().split())
a = list(map(int, input().split()))
ans = 0


dp = [[0]*(s+1) for i in range(n+1)]
dp[0][0] = 1
for i in range(n):
    for j in range(s+1):
        if j + a[i] <= s:
            dp[i+1][j+a[i]] += dp[i][j]
        dp[i+1][j] += dp[i][j]

ans = 0
for i in range(n):
    ans += (i+1)*dp[-1-i][s]

print(ans)
