#include <bits/stdc++.h>
using namespace std;

const int C = 50 * 50 + 5;
int n, m;
long long dp[55][2 * 55 * 55];

int main() {
	scanf("%d%d", &n, &m);

	for(int i = 1; i <= n; i++) {
		int x; scanf("%d", &x);
		x -= m;

		for(int j = 50 * 50; j >= -50 * 50; j--) {
			if(j - x <= 50 * 50 && j - x >= -50 * 50) {
				dp[i][j + C] += dp[i - 1][j - x + C];
				dp[i][j + C] += dp[i - 1][j + C];
			}
		}

		dp[i][x + C]++;
	}

	printf("%lld\n", dp[n][C]);
	return 0;
}