import java.util.Scanner;

public class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		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][N + 1][50 * N + 1];
		dp[0][0][0] = 1;
		for (int i = 0; i < N; ++i) {
			for (int j = 0; j <= i; ++j) {
				for (int k = 0; k + X[i] < dp[0][0].length; ++k) {
					dp[i + 1][j][k] += dp[i][j][k];
					dp[i + 1][j + 1][k + X[i]] += dp[i][j][k];
				}
			}
		}
		long ans = 0;
		for (int i = 1; i <= N; ++i) {
			ans += dp[N][i][A * i];
		}
		System.out.println(ans);
	}

}
