#include <cstdio>

const int M = 50 * 50 + 1;

long long ways[M + M];

int main()
{
    int n, a;
    scanf("%d%d", &n, &a);
    ways[M] = 1;
    for (int i = 0, x; i < n; ++ i) {
        scanf("%d", &x);
        x -= a;
        if (x >= 0) {
            for (int j = M + M - 1; j >= x; -- j) {
                ways[j] += ways[j - x];
            }
        } else {
            for (int j = 0; j - x < M + M; ++ j) {
                ways[j] +=ways[j - x];
            }
        }
    }
    printf("%lld\n", ways[M] - 1);
}
