#include <cstdio>
typedef long long int64;
static const int MAXN = 52;
static const int MAXA = 50 * 52;

int n, a, x_i;
int64 ways[MAXN][MAXA] = {{ 1, 0 }};

int main()
{
    scanf("%d%d", &n, &a);
    for (int i = 0; i < n; ++i) {
        scanf("%d", &x_i);
        for (int j = i; j >= 0; --j)
            for (int k = MAXA - x_i; k >= 0; --k)
                ways[j + 1][k + x_i] += ways[j][k];
    }

    int64 ans = 0;
    for (int i = 1; i <= n; ++i) ans += ways[i][i * a];
    printf("%lld\n", ans);

    return 0;
}
