using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using static System.Console;
using static System.Math;

class Program
{
    static void Main(string[] args)
    {
        int[] NA = ReadLineParseIntArray();
        long N = NA[0];
        long A = NA[1];
        long[] X = ReadLine().Split(' ').Select(x => int.Parse(x) - A).ToArray();
        long max = X.Max();

        long[] dp = new long[2 * max * N + 1];
        dp[N * max] = 1;
        for(int i = 0; i < N; i++)
        {
            long first = Max(0, X[i]);
            long last = Min(dp.Length, dp.Length + X[i]);
            if (X[i] <= 0)
                for (long t = first; t < last; t++)
                    dp[t] += dp[t - X[i]];
            else
                for (long t = last - 1; t >= first; t--)
                    dp[t] += dp[t - X[i]];
        }
        WriteLine(dp[N * max] - 1);
    }

    static int ReadLineParseInt() => int.Parse(ReadLine());
    static int[] ReadLineParseIntArray() => ReadLine().Split(' ').Select(int.Parse).ToArray();
}