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
#include<bits/stdc++.h>
using namespace std;

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second

using vint=vector<int>;
using pint=pair<int,int>;
using vpint=vector<pint>;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

template<class A,class B>
ostream& operator<<(ostream& ost,const pair<A,B>&p){
	ost<<"{"<<p.first<<","<<p.second<<"}";
	return ost;
}

template<class T>
ostream& operator<<(ostream& ost,const vector<T>&v){
	ost<<"{";
	for(int i=0;i<v.size();i++){
		if(i)ost<<",";
		ost<<v[i];
	}
	ost<<"}";
	return ost;
}

inline int topbit(unsigned long long x){
	return x?63-__builtin_clzll(x):-1;
}

inline int popcount(unsigned long long x){
	return __builtin_popcountll(x);
}

inline int parity(unsigned long long x){
	return __builtin_parity(x);
}

int C[55][55];

int N,K,S,T;

int num[55];
int cnt[1<<18];
signed main(){
	rep(i,55){
		C[i][0]=C[i][i]=1;
		for(int j=1;j<i;j++)C[i][j]=C[i-1][j-1]+C[i-1][j];
	}
	cin>>N>>K>>S>>T;

	for(int i=1;i<=N;i++){
		for(int k=1;k<=K;k++)num[i]+=C[i][k];
	}

	swap(S,T);
	
	if((S&T)!=T){
		cout<<0<<endl;
		return 0;
	}

	vint A;
	rep(i,N){
		int a;cin>>a;
		if((a&T)!=T)continue;
		if((a&S)!=a)continue;
		int aa=0;
		rep(j,18){
			if(T>>j&1)continue;
			if(!(S>>j&1))continue;
			aa=aa*2+(a>>j&1);
		}
		A.pb(aa);
	}

	int B=0;
	rep(i,18){
		if(T>>i&1)continue;
		if(!(S>>i&1))continue;
		B++;
	}


	int ans=0;
	rep(i,1<<B){
		for(auto a:A){
			cnt[a&i]++;
		}
		int tmp=0;
		for(auto a:A){
			tmp+=num[cnt[a&i]];
			cnt[a&i]=0;
		}
		if(parity(i))ans-=tmp;
		else ans+=tmp;
	}
	cout<<ans<<endl;
	return 0;
}
