Problem: Given are N pairwise distinct non-negative integers A_1,A_2,\ldots,A_N. Find the number of ways to choose a set of between 1 and K numbers (inclusive) from the given numbers so that the following two conditions are satisfied:

* The bitwise AND of the chosen numbers is S.
* The bitwise OR of the chosen numbers is T.

Constraints

* 1 \leq N \leq 50
* 1 \leq K \leq N
* 0 \leq A_i < 2^{18}
* 0 \leq S < 2^{18}
* 0 \leq T < 2^{18}
* A_i \neq A_j (1 \leq i < j \leq N)

Input

Input is given from Standard Input in the following format:


N K S T
A_1 A_2 ... A_N


Output

Print the answer.

Examples

Input

3 3 0 3
1 2 3


Output

2


Input

5 3 1 7
3 4 9 1 5


Output

2


Input

5 4 0 15
3 4 9 1 5


Output

3

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i ++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i ++)
#define MP make_pair

using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
const int MOD = 998244353;

int n, a[55], k, s, t;
LL comb[55][55];
LL hv[25];
LL ab[262144], ob[262144];

int main()
{
	scanf("%d%d%d%d", &n, &k, &s, &t);
	rep(i, n) scanf("%d", &a[i]);
	if((s & t) != s) {
		printf("0\n");
		return 0;
	}
	comb[0][0] = 1;
	rep(i, n + 1) rep(j, n + 1) {
		comb[i + 1][j] += comb[i][j];
		comb[i + 1][j + 1] += comb[i][j];
	}
	rep(i, n + 1) {
		comb[i][0] = 0;
		rep1(j, n) comb[i][j] += comb[i][j - 1];
	}
	
	rep(i, n) rep(j, 18) if(a[i] >> j & 1) hv[j] |= 1LL << i;
	rep(i, 262144) {
		ab[i] = (1LL << n) - 1;
		rep(j, 18) if(i >> j & 1) ab[i] &= hv[j];
		ob[i] = (1LL << n) - 1;
		rep(j, 18) if(!(i >> j & 1)) ob[i] &= ~hv[j];
	}
	t ^= s;
	
	LL ans = 0;
	for(int i = t; i != -1; i = i - 1 & t) {
		for(int j = i; j != -1; j = j - 1 & i) {
			if(__builtin_parity(t ^ i ^ j)) ans -= comb[__builtin_popcountll(ab[j | s] & ob[i | s])][k];
			else ans += comb[__builtin_popcountll(ab[j | s] & ob[i | s])][k];
			if(j == 0) break;
		}
		if(i == 0) break;
	}
	printf("%lld\n", ans);
	return 0;
}