#pragma GCC optimize("Ofast") #include #define rep(i,n) for(int i=0;i>x[i]; #define ft first #define sc second #define pb push_back #define lb lower_bound #define ub upper_bound #define all(v) (v).begin(),(v).end() #define LB(a,x) lb(all(a),x)-a.begin() #define UB(a,x) ub(all(a),x)-a.begin() #define mod 1000000007 //#define mod 998244353 #define FS fixed< using V=vector; using Graph = vector>; using P=pair; typedef unsigned long long ull; typedef long double ldouble; template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template inline void out(T a){ cout << a << '\n'; } void YN(bool ok){if(ok) cout << "Yes" << endl; else cout << "No" << endl;} //void YN(bool ok){if(ok) cout << "YES" << endl; else cout << "NO" << endl;} const ll INF=1e18; const int mx=200005; ll dp[105][10005]; int main(){ cin.tie(0);ios::sync_with_stdio(false); int n,kk; cin>>n>>kk; V a(n); rep(i,n){ cin>>a[i]; a[i]-=kk; } sort(all(a)); int pos=lb(all(a),0)-a.begin(); dp[0][0]=1; for(int i=0;i tmp(10001,0); if(a[i]>=0){ for(int j=-10000;j<=0;j++){ tmp[-j]+=dp[i][-j]; tmp[-j]%=mod; ll tmp2=min(0,j+a[i]); tmp[-tmp2]+=dp[i][-j]; tmp[-tmp2]%=mod; } }else{ for(int j=0;j>=-10000;j--){ tmp[-j]+=dp[i][-j]; tmp[-j]%=mod; ll tmp2=max(-10000,j+a[i]); tmp[-tmp2]+=dp[i][-j]; tmp[-tmp2]%=mod; } } for(int j=0;j<=10000;j++) dp[i+1][j]=tmp[j]; } dp[n][0]--; if(dp[n][0]<0) dp[n][0]+=mod; out(dp[n][0]); }