import std.stdio;
import std.string;
import std.conv;

int N, A;
int[] X;

long f(int i, int n, int sum) {
    if (i == N) { 
        if (n == 0) return 0;
        // writef("n: %d, sum: %d", n, sum);
        // writefln(" %s", (sum == A * n ? "Yes" : "No"));
        return (sum == A * n ? 1 : 0);
    }
    return f(i + 1, n + 1, sum + X[i]) + f(i + 1, n, sum);
}

void main()
{
    int[] buf = readln.chomp.split.to!(int[]);
    N = buf[0], A = buf[1];
    X = readln.chomp.split.to!(int[]);

    f(0, 0, 0).writeln;
}
