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<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<map>
#include<queue>
#include<deque>
#include<iomanip>
#include<tuple>
#include<cassert>
using namespace std;
typedef long long int LL;
typedef pair<int,int> P;
typedef pair<LL,int> LP;
const int INF=1<<30;
const LL MAX=1e9+7;

void array_show(int *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%d%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(LL *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%lld%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(vector<int> &vec_s,int vec_n=-1,char middle=' '){
	if(vec_n==-1)vec_n=vec_s.size();
	for(int i=0;i<vec_n;i++)printf("%d%c",vec_s[i],(i!=vec_n-1?middle:'\n'));
}
void array_show(vector<LL> &vec_s,int vec_n=-1,char middle=' '){
	if(vec_n==-1)vec_n=vec_s.size();
	for(int i=0;i<vec_n;i++)printf("%lld%c",vec_s[i],(i!=vec_n-1?middle:'\n'));
}

const int N=18;

vector<int> vt;
int x,y;
int n,m;
LL cnt[55];

LL check(int bit,vector<int>& v1){
	if(v1.empty())return 0;
	LL s=0;
	if(bit==N){
		int a=v1.size();
		if(a<=m)return ((LL)1<<a)-1;
		else return cnt[a];
	}
	s=check(bit+1,v1);
	vector<int> v2,v3;
	for(auto num:v1){
		if(num&(1<<bit))v3.push_back(num);
		else v2.push_back(num);
	}
	if(y&(1<<bit))s-=check(bit+1,v2);
	if(~x&(1<<bit))s-=check(bit+1,v3);
	return s;
}

int main(){
	int i,j,k;
	LL a,b,c;
	cin>>n>>m>>x>>y;
	for(i=0;i<n;i++){
		cin>>a;
		if((a&x)!=x || (a|y)!=y)continue;
		vt.push_back(a);
	}
	for(i=m+1;i<=n;i++){
		a=0,b=1;
		for(j=0;j<m;j++){
			b*=i-j;
			b/=j+1;
			a+=b;
		}
		cnt[i]=a;
	}
	cout<<check(0,vt)<<endl;
}