#include <bits/stdc++.h>
using namespace std;
int n, a;
int v[55];
int dp[55][3000];
int main() {
  cin >> n >> a;
  for (int i = 1; i <= n; i++) {
    cin >> v[i];
  }
  long long ans = 0;
  int sum;
  for (int z = a; z <= a * n; z = z + a) {
    sum = z;
    memset(dp, 0, sizeof(dp));
    for (int i = 0; i <= n; ++i) {
      dp[i][0] = 1;
    }
    for (int j = 1; j <= sum; ++j) {
      dp[0][j] = 0;
    }
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= sum; ++j) {
        if (v[i] > j) {
          dp[i][j] = dp[i - 1][j];
        } else {
          dp[i][j] = dp[i - 1][j] + dp[i - 1][j - v[i]];
        }
      }
    }
    ans += dp[n][sum];
  }
  cout << ans << endl;
  return 0;
}
