using System;
using System.Linq;

 class Program
    {
        static void Main(string[] args)
        {
            // get a inputs
            var line1 = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            var N = line1[0];
            var A = line1[1];
            var arr = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

            //output
            Console.WriteLine(Recurse(0, 0, 0, arr, A));
        }

     public static int Recurse(int pos, int sum, int divisor, int[] arr, int target)
        {
            if (pos == arr.Length) // only eval at the end
            {
                if (divisor > 0 && sum == divisor * target) 
                    return 1;
                else
                    return 0;
            }
            else
            {
                return Recurse(pos + 1, sum, divisor, arr, target) +
                        Recurse(pos + 1, sum + arr[pos], divisor + 1, arr, target);
            }
        }

    }