import std.stdio, std.string, std.array, std.conv, std.algorithm, std.typecons, std.range, std.container, std.math, std.algorithm.searching, std.functional,std.mathspecial;

void main(){
    auto na=readln.chomp.split.map!(to!int).array;
    auto xs=readln.chomp.split.map!(to!int);
    auto diffs=xs.map!(x=>x-na[1]);
    auto zeroes=diffs.filter!"a==0".count;
    auto noneZeroes=diffs.filter!"a!=0".array;
    
    long[int] counts;
    counts[0]=1;

    foreach(n;noneZeroes){
        foreach(k,ns;counts.dup){
            counts[k+n]+=ns;
        }
    }

    writeln(counts[0]*(2L^^(zeroes))-1);
}