#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
typedef long long ll;
int n,a;
int x[55];

ll dp[55][55][55*55];
ll solve(int k,int c,int s){
  if(k == n){
    return (c*a==s?1:0);
  }
  if(dp[k][c][s] >= 0) return dp[k][c][s];
  return dp[k][c][s] = solve(k+1,c+1,s+x[k]) + solve(k+1,c,s);
}

int main(void){
  cin >> n >> a;
  for(int i = 0; i < n; i++){
    cin >> x[i];
  }
  memset(dp,-1,sizeof(dp));
  cout << solve(0,0,0)-1 << endl;
}
