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

    dp=[[[0 for _ in range(50*n+1)] for _ in range(n+1)] for _ in range(n+1)]
    dp[0][0][0]=1
    
    for i in range(n+1):
        for j in range(i+1):
            for k in range(50*j+1):
                if i>0 and k<x[i-1]:
                    dp[i][j][k]=dp[i-1][j][k]
                elif i>0 and j>0 and k>=x[i-1]:
                    dp[i][j][k]=dp[i-1][j][k]+dp[i-1][j-1][k-x[i-1]]
    ans=0
    for i in range(n):
        ans+=dp[n][i+1][(i+1)*a]
    print(ans)

if __name__ == "__main__":
    main()