// tested by Hightail - https://github.com/dj3500/hightail
import std.stdio, std.string, std.conv, std.algorithm;
import std.range, std.array, std.math, std.typecons, std.container, core.bitop;
import std.datetime, std.bigint;

int n, a;
int[] x;

void main() {
    scan(n, a);
    x = readln.split.to!(int[]);

    auto dp = new long[][][](n + 1, n + 1, 2500 + 1);
    dp[0][0][0] = 1;

    foreach (i ; 0 .. n) {
        foreach (j ; 0 .. n + 1) {
            foreach (k ; 0 .. 2500 + 1) {
                if (dp[i][j][k] == 0) continue;
                dp[i + 1][j][k] += dp[i][j][k];
                dp[i + 1][j + 1][k + x[i]] += dp[i][j][k];
            }
        }
    }

    long ans;

    foreach (j ; 1 .. n + 1) {
        ans += dp[n][j][j * a];
    }

    writeln(ans);
}



void scan(T...)(ref T args) {
    string[] line = readln.split;
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}


void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}