n,a=map(int,raw_input().split())
x=map(int,raw_input().split())
x.sort()
dp=[[[0]*(n+1) for i in xrange(n*a+1)] for j in xrange(n+1)]
for i in xrange(n+1):
    dp[i][0][0]=1
ans=0
for i in xrange(n):
    for j in xrange(1,n*a+1):
        for k in xrange(1,n+1):
            if i+1<k:break
            if j<x[i]:
                dp[i+1][j][k]=dp[i][j][k]
                continue
            dp[i+1][j][k]=dp[i][j][k]+dp[i][j-x[i]][k-1]
for j in xrange(1,n*a+1):
    for k in xrange(1,n+1):
        if j==a*k:
            ans+=dp[n][j][k]
print(ans)