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 "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"

using namespace std;

constexpr long long int MOD = 1000000007;
//constexpr int MOD = 1000000007;
//constexpr int MOD = 998244353;
//constexpr long long int MOD = 998244353;
constexpr double EPS = 1e-9;

//int N, M, K, H, W, L, R;
long long int N, M, K, H, W, L, R;


int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	cin >> N >> K;
	cin >> L >> R;
	if ((R&L) != L) {
		cout << 0 << endl;
		return 0;
	}
	vector<int>v;
	for (int i = 0; i < N; i++) {
		cin >> M;
		if ((L&M) != L)continue;
		if ((R | M) != R)continue;
		v.push_back(M);
	}
	R -= L;
	L = 0;
	for (auto &i : v)i -= L;
	vector<vector<long long int>>binom(N + 1, vector<long long int>(N + 1, 0));
	for (int i = 1; i <= N; i++) {
		binom[i][1] = i;
	}
	for (int i = 2; i <= N; i++) {
		for (int j = 2; j <= i; j++) {
			binom[i][j] += binom[i - 1][j] + binom[i - 1][j - 1];
		}
	}
	for (int i = 1; i <= N; i++) {
		for (int j = 2; j <= K; j++) {
			binom[i][j] += binom[i][j - 1];
		}
	}
	long long int ans = 0;
	ans+=binom[v.size()][K];
	for (int i = 1; i < (1 << 18); i++) {
		if ((i&R) != i)continue;
		map<int, int>mp;
		for (auto j : v) {
			mp[j&i]++;
		}
		int box = i;
		int num = 0;
		while (box) {
			num += box & 1;
			box >>= 1;
		}
		for (auto j : mp) {
		//	cout << i << " " << j.first << " " << j.second << endl;
			if (num & 1) {
				ans -= binom[j.second][K];
		//		ans %= MOD;
			}
			else {
				ans += binom[j.second][K];
		//		ans %= MOD;
			}
		}
	}
	cout << ans << endl;
}