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 negaes=diffs.filter!"a<0".array;
    auto zeroes=diffs.filter!"a==0".count;
    auto posies=diffs.filter!"a>0".array;
    
    long[int] negaSet;
    negaSet[0]=1;
    long[int] posiSet;
    posiSet[0]=1;

    foreach(n;negaes){
        foreach(k,ns;negaSet.dup){
            negaSet[k-n]+=ns;
        }
    }
    foreach(n;posies){
        foreach(k,ns;posiSet.dup){
            posiSet[k+n]+=ns;
        }
    }

    long res=0;
    foreach(k,n;negaSet){
        auto p=k in posiSet;
        if(p!=null)res+=n*(*p);
    }
    writeln(res*(2L^^(zeroes))-1);
}
