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

    int[] x = new int[] { 0 };
    x = x.Concat(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 <= i; ++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);
  }
}
