import core.bitop;
import std.algorithm;
import std.ascii;
import std.bigint;
import std.conv;
import std.functional;
import std.format;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.random;
import std.typecons;

alias sread = () => readln.chomp();
alias Point2 = Tuple!(long, "y", long, "x");

T lread(T = long)()
{
    return readln.chomp.to!T();
}

T[] aryread(T = long)()
{
    return readln.split.to!(T[])();
}

void scan(TList...)(ref TList Args)
{
    auto line = readln.split();
    foreach (i, T; TList)
    {
        T val = line[i].to!(T);
        Args[i] = val;
    }
}

enum MOD = (10 ^^ 9) + 7;

void main()
{
    long N, A;
    scan(N, A);
    auto X = aryread();
    long S = X.sum();
    auto dp = new long[][][](N + 1, N + 1, S + 1);
    dp[0][0][0] = 1;
    foreach (i; 0 .. N)
        foreach (j; 0 .. N)
            foreach (k; 0 .. S + 2)
            {
                if (0 <= k - X[i])
                    dp[i + 1][j + 1][k] += dp[i][j][k - X[i]];
                dp[i + 1][j][k] += dp[i][j][k];
            }
    // foreach (row; dp[0])
    //     writeln(row);
    // writeln();
    // foreach (row; dp[N])
    //     writeln(row);
    long ans;
    foreach (i; 1 .. N + 1)
    {
        ans += dp[N][i][A * i];
    }
    writeln(ans);
}
