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