#include <bits/stdc++.h>
using namespace std;
int n, a, x, dp[55][2505], cnt = 0;
int main() {
  scanf("%d%d", &n, &a);
  dp[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    for (int j = i - 1; j >= 0; j--) {
      for (int k = 2500; k >= 0; k--) {
        if (k + x <= 2500) {
          dp[j + 1][k + x] += dp[j][k];
        }
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    cnt += dp[i][a * i];
  }
  printf("%d\n", cnt);
}
