#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <iomanip>
using namespace std;
#define rep(i,x,n) for(int i=x;i<n;i++)
#define repd(i,x,n) for(int i=x;i<=n;i++)
typedef long long ll;
ll dp[55][55 * 55];
int k;
int n;
int main()
{
    cin >> n >> k;
    int x;
    dp[0][0] = 1ll;
    repd(i, 1, n)
    {
        cin >> x;
        for (int j = i - 1; j >= 0; j--)
        {
            for (int w = 0; w <= 55 * j; w++)
            {
                dp[j + 1][w + x] += dp[j][w];
            }
        }
    }
    ll ans = 0ll;
    repd(i, 1, n)
    {
        ans += dp[i][i * k];
    }
    cout << ans << endl;
    return 0;
}