// 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[]);

    x[] -= a;

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

    dp[0][2500] = 1;

    foreach (i ; 0 .. n) {
        foreach (j ; 0 .. 5000 + 1) {
            dp[i + 1][j] += dp[i][j];
            dp[i + 1][j + x[i]] += dp[i][j];
        }
    }

    writeln(dp[n][2500] - 1);
}



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);
        }
    }
}