#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector< vector<int> > VVI;
typedef pair<int,int> PII;
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a) (a).begin(),(a).end()

int main(){
  int N,A;
  cin>>N>>A;
  VI X(N);
  rep(i,N) cin>>X[i];
  ll dp[N+1][N+1][2500]={};
  dp[0][0][0]=1;
  rep(i,N){
    rep(j,2500){
      rep(k,i+1){
        if(dp[i][k][j]){
          dp[i+1][k+1][j+X[i]]+=dp[i][k][j];
          dp[i+1][k][j]+=dp[i][k][j];
        }
      }
    }
  }
  ll ans=0;
  rep(i,N) ans+=dp[N][i+1][(i+1)*A];
  cout<<ans<<endl;
}