#include<cstdio>
#include <map>
#include<iostream>
#include<string.h>
#include<algorithm>
using namespace std;

typedef __int64 LL;

int x[60];;
long long dp[60][60][2600];
int main()
{
    int n, a;
    scanf("%d%d", &n, &a);
    for(int i = 1; i <= n; ++i)
        scanf("%d", &x[i]);
    for(int i = 0; i <= n; ++i)
        dp[i][0][0] = 1;
    for(int i = 1; i <= n; ++i)
    {
        for(int j = 1; j <= i; ++j)
        {
            for(int k = 0; k <= 2500; ++k)
            {
                if(k - x[i] >= 0)
                    dp[i][j][k] += dp[i - 1][j - 1][k - x[i]];
                dp[i][j][k] += dp[i - 1][j][k];
            }
        }
    }
    long long ans = 0;
    for(int i = 1; i <= n; ++i)
        ans += dp[n][i][a * i];
    printf("%lld\n", ans);


    return 0;
}



