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
//Awwawa! Dis cold yis ratten buy waxberry!
#include <bits/stdc++.h>
#define ll long long
#define maxn 200005 /*rem*/
#define mod 998244353
#define db double
#define vi vector<int>
#define pb push_back
#define mp make_pair
#define pi pair<int, int>
#define fi first
#define se second

template <typename T> bool chkmax(T &x,T y){return x<y?x=y,true:false;}
template <typename T> bool chkmin(T &x,T y){return x>y?x=y,true:false;}

using namespace std;
ll c[55][55];
ll sum[55];
int n, k, s, t;
int a[maxn];
int qr[300005];
int ns[300005];
int id[maxn];
int main() {
	for (int i = 0; i < 55; i++)
		for (int j = 0; j <= i; j++) {
			if (j == 0 || j == i) c[i][j] = 1;
			else c[i][j] = c[i - 1][j] + c[i - 1][j - 1];
		}
	cin >> n >> k >> s >> t;
	for (int i = 0; i <= n; i++) {
		sum[i] = 0;
		for (int j = 1; j <= k; j++)
			sum[i] += c[i][j];
	}
	int cnt = 0;
	while (n--) {
		int r;
		scanf("%d", &r);
		if ((r & s) == s && ((t & r) == r)) a[++cnt] = r;
	}
	ll ans = 0;
	int dv = (t ^ s);
	for (int l = dv; 1; l = (l - 1) & dv) {
		int df = 1;
		for (int j = 0; j < 18; j++)
			if (l & (1 << j)) df *= -1;
		for (int i = 1; i <= cnt; i++) {
			qr[a[i] & l]++;
			id[i] = qr[a[i] & l];
		}
		for (int i = 1; i <= cnt; i++) {
			int p = qr[a[i] & l];
			if (p == id[i]) ans += df * sum[p];
		}
		for (int i = 1; i <= cnt; i++)
			qr[a[i] & l] = 0;
		if (l == 0) break;
	}
	cout << ans << endl;
	return 0;
}
