import std.algorithm,
       std.string,
       std.range,
       std.stdio,
       std.conv;

void main() {
  long[][51][51] dp;
  foreach (ref e1; dp)
    foreach (ref e2; e1)
      e2.length = 50^^2 + 1;
  int[2] input = readln.chomp.split.to!(int[2]);
  int N = input[0],
      A = input[1];
  int[] x = readln.chomp.split.to!(int[]);
  dp[0][0][0] = 1;

  foreach (i; N.iota) {
    foreach (j; N.iota) {
      foreach (k; (50^^2 + 1).iota) {
        dp[i + 1][j][k] += dp[i][j][k];
        if (k + x[i] >= 50^^2 + 1) continue;
        dp[i + 1][j + 1][k + x[i]] += dp[i][j][k];
      }
    }
  }

  long ans;

  foreach (i; 1.iota(N+1)) {
    ans += dp[N][i][i * A];
  }

  writeln(ans);
}