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

namespace CSharp
{
    class Program
    {
        static long Solve(int[] X, long?[,,] memo, int no, int count, int sum)
        {
            if (no == X.Length || sum <= 0)
            {
                return sum == 0 && count == 0 ? 1 : 0;
            }
            if (count <= 0)
            {
                return 0;
            }
            if (memo[no, count, sum] != null)
            {
                return memo[no, count, sum].GetValueOrDefault();
            }

            return (memo[no, count, sum] = Solve(X, memo, no + 1, count, sum)
                                           + Solve(X, memo, no + 1, count - 1, sum - X[no])).GetValueOrDefault(); ;
        }

        static void Main(string[] args)
        {
            int n, a;
            ReadInt(out n, out a);
            int[] X = ReadIntArray();

            long ans = 0;
            long?[,,] memo = new long?[55, 55, 3000];
            for (int i = 1; i <= n; i++)
            {
                ans += Solve(X, memo, 0, i, i * a);
            }

            Console.WriteLine(ans);
        }

        #region Helpers

        static int[] ReadIntArray() => Console.ReadLine().Split().Select(s => int.Parse(s)).ToArray();
        static long[] ReadLongArray() => Console.ReadLine().Split().Select(s => long.Parse(s)).ToArray();

        static string ReadString() => Console.ReadLine();
        static int ReadInt() => int.Parse(Console.ReadLine());
        static long ReadLong() => long.Parse(Console.ReadLine());

        static void ReadInt(out int first)
        {
            var array = ReadIntArray();
            first = array[0];
        }

        static void ReadInt(out int first, out int second)
        {
            var array = ReadIntArray();
            first = array[0];
            second = array[1];
        }

        static void ReadInt(out int first, out int second, out int third)
        {
            var array = ReadIntArray();
            first = array[0];
            second = array[1];
            third = array[2];
        }

        static void ReadInt(out int first, out int second, out int third, out int fourth)
        {
            var array = ReadIntArray();
            first = array[0];
            second = array[1];
            third = array[2];
            fourth = array[3];
        }

        static void ReadLong(out long first)
        {
            var array = ReadLongArray();
            first = array[0];
        }

        static void ReadLong(out long first, out long second)
        {
            var array = ReadLongArray();
            first = array[0];
            second = array[1];
        }

        static void ReadLong(out long first, out long second, out long third)
        {
            var array = ReadLongArray();
            first = array[0];
            second = array[1];
            third = array[2];
        }

        static void ReadLong(out long first, out long second, out long third, out long fourth)
        {
            var array = ReadLongArray();
            first = array[0];
            second = array[1];
            third = array[2];
            fourth = array[3];
        }

        #endregion
    }
}

Measured memory_bytes: 142176