#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
int dp[51][2600];
int main() {
  int n, a;
  cin >> n >> a;
  dp[0][0] = 1;
  for (int((i)) = (0); ((i)) < ((n)); ((i))++) {
    int x;
    cin >> x;
    for (int j = 2560 - x; j >= 0; j--)
      for (int k = 50; k >= 1; k--) dp[k][j + x] += dp[k - 1][j];
  }
  long long ans = 0;
  for (int i = 1; i < 2550; i++)
    for (int j = 1; j < 51; j++)
      if (i == a * j) ans += dp[j][i];
  cout << ans << endl;
}
