import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int[] x = new int[N];
		for(int i=0; i<N; i++)
			x[i] = sc.nextInt();
		
		long[][] dp = new long[N+1][50*N+1];
		dp[0][0] = 1;
		for(int i=0; i<N; i++)
			for(int j=i; j>=0; j--)
				for(int k=0; k<=50*i; k++)
					dp[j+1][k+x[i]] += dp[j][k];
		
		long ans = 0;
		for(int i=1; i<=N; i++)
			ans += dp[i][i*A];
		System.out.println(ans);
		sc.close();
	}
}
