using System;
using System.Linq;
class Program
{
  static void Main(string[] args)
  {
    string[] input = Console.ReadLine().Split(' ');
    int N = int.Parse(input[0]);
    int A = int.Parse(input[1]);

    int[] x = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

    long[][][] dp = new long[N + 1][N + 1][N * A + 1];

    for (int i = 0; i < N; ++i) dp[i][0][0] = 1;

    for (int i = 1; i <= N; ++i) {
      for (int j = 1; j <= N; ++j) {
        for (int k = 1; k <= N * A; ++k) {
          if (k < x[i]) {
            dp[i][j][k] = dp[i - 1][j][k];
          } else {
            dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - x[i]];
          }
        }
      }
    }

		long ans = 0;
		for (int j = 1; j <= N; ++j) {
			ans += dp[N][j][j*A];
		}

    Console.WriteLine(ans);
  }
}
