import sys 
MOD = 10**9 +7
INF = 10**5

def main():
    n,s = map(int,input().split())
    a = list(map(int,input().split()))

    dp = [[0] * (s + 1) for _ in range(n + 1)]
    for i in range(n):
        num = a[i]
        for j in range(1,s + 1):
            dp[i + 1][j] = dp[i][j] + dp[i][j - a[i]]
    
    print(dp[-1][-1])
if __name__=='__main__':
    main()