using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ARC060_C2
{
    class Program
    {
        static void Main(string[] args)
        {
            long ans = 0;
            var t = scan;
            int n = t[0];
            int a = t[1];
            var x = scan;
            int S = 1 << n;
            if (n > 16) goto end;
            for (int i = 1; i < S; i++)
            {
                int k = i;
                var P = new HashSet<int>();
                int count = 0;
                while (k>0)
                {
                    if ((k & 1) == 1) P.Add(x[count]);
                    k = k >> 1;
                    count++;
                }
                if (P.Sum() % P.Count == 0 && P.Sum() / P.Count == a)
                {
                    ans++;
                    //Console.WriteLine(i);
                }
            }
            end:;
            Console.WriteLine(ans);        
        }

        static int[] scan
        {
            get { return Console.ReadLine().Split().Select(int.Parse).ToArray(); }
        }
    }
}
