import std.stdio, std.string, std.conv;
import std.algorithm, std.array;
import std.math;
 
auto solve(string s_)
{
    auto NA = s_.split.map!(to!int)();
    immutable N=NA[0], A=NA[1];
    immutable xs=readln.split.map!(to!int).array();
    immutable M=N*A+1;
    auto dp = new long[][](N+1,M); dp[0][0]=1;
    foreach(int k,x;xs)
    {
        foreach_reverse(j;0..k+1)
            foreach(i;0..max(0,M-x))
                dp[j+1][i+x]+=dp[j][i];
    }
    long c=0;
    foreach(i;1..N+1) c+=dp[i][i*A];
    return c;
}

void main(){ for(string s; (s=readln.chomp()).length;) writeln(solve(s)); }