//#include #include #include #include #include #include #include #include // string, to_string, stoi #include // vector #include // min, max, swap, sort, reverse, lower_bound, upper_bound #include // pair, make_pair #include // tuple, make_tuple #include // int64_t, int*_t #include // printf #include // map #include // queue, priority_queue #include // set #include // stack #include // deque #include // unordered_map #include // unordered_set #include // bitset #include // isupper, islower, isdigit, toupper, tolower using namespace std; //using namespace atcoder; using ll = long long; #define all(A) A.begin(),A.end() using vll = vector; #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) using Graph = vector>>; class quo{ public: ll de; ll nu; ll gcd(ll a,ll b){ ll c = a; while (a % b != 0) { c = a % b; a = b; b = c; } return b; } quo re(){ quo res; ll g=gcd(this->de,this->nu); res.de=this->de/g; res.nu=this->nu/g; return res; } quo operator +(const quo &a){ quo c; c.nu=this->nu*a.nu; c.de=this->nu*a.de+this->de*a.nu; return c.re(); } quo operator -(const quo &a){ quo c; c.nu=this->nu*a.nu; c.de=-this->nu*a.de+this->de*a.nu; return c.re(); } quo operator *(const quo &a){ quo c; c.nu=this->nu*a.nu; c.de=this->de*a.de; return c.re(); } }; int main(){ ll mod=1e9+7; ll N,K; cin>>N>>K; vll A(N); rep(i,N){ cin>>A[i]; A[i]-=K; } vector DP(N+1,vll(30000,0)); DP[0][15000]=1; rep(i,N){ rep(j,30000){ if(DP[i][j]!=0){ DP[i+1][j]+=DP[i][j]; DP[i+1][j]%=mod; DP[i+1][j+A[i]]+=DP[i][j]; DP[i+1][j+A[i]]%=mod; } } } ll an=mod-1; for(ll i=15000;i<30000;i++){ an+=DP[N][i]; } cout<