using System;
using System.Linq;

public class Program
{
	public static void Main()
	{
		int[] NA = Console.ReadLine().Split().Select(i => int.Parse(i))
			.ToArray();
		int N = NA[0], A = NA[1];
		int[] x = Console.ReadLine().Split().Select(i => int.Parse(i))
			.ToArray();
		long ans = 0;
		for (long i = 1; i < (1 << N); i++)
		{
			int counter = 0;
			int sum = 0;
			for (int j = 0; j < N; j++)
			{
				if (((i >> j) % 2) == 1)
				{
					counter++;
					sum += x[j];
				}
			}
			if (sum == counter * A) {
				ans++;
			}
		}
		Console.WriteLine(ans);
	}
}