#include <bits/stdc++.h>
using namespace std;
long long dp[55][2600];
long long x[55];
signed main() {
  long long n, a;
  cin >> n >> a;
  for (long long i = 0; i < n; i++) cin >> x[i];
  dp[0][0] = 1;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j <= 2500; j++) {
      if (j >= x[i]) dp[i + 1][j] += dp[i][j - x[i]];
      dp[i + 1][j] += dp[i][j];
    }
  }
  long long ans = 0;
  for (long long i = 1; i <= 2500; i++) {
    if (i % a == 0) ans += dp[n][i];
  }
  cout << ans << endl;
}
