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>
typedef long long LL;
typedef double dl;
#define opt operator
#define pb push_back
const LL maxn=1e6+9,mod=998244353;
LL Read(){
	LL x(0),f(1); char c=getchar();
	while(c<'0' || c>'9'){
		if(c=='-') f=-1; c=getchar();
	}
	while(c>='0' && c<='9'){
		x=(x<<3ll)+(x<<1ll)+c-'0'; c=getchar();
	}return x*f;
}
LL n,K,s,t;
LL f[maxn],C[61][61],g[61],vis[61],a[maxn],mark[maxn],pos[maxn],lg[maxn];
int main(){
    n=Read(); K=Read(); s=Read(); t=Read();
    for(LL i=1;i<=n;++i){
    	a[i]=Read();
	}
	LL tot(0);
    for(LL i=0;i<18;++i){
    	if((s&(1<<i))==(t&(1<<i))){
    		for(LL j=1;j<=n;++j) if((a[j]&(1<<i))!=(s&(1<<i))){
    			vis[j]=1;
			}
		}else{
			mark[i]=1; pos[i]=tot++;
		}
	}
	//for(LL j=1;j<=n;++j) printf("%d ",vis[j]); puts("");
	for(LL j=1;j<=n;++j){
		LL ret(0);
		for(LL i=0;i<18;++i) if(mark[i]){
			ret+=((a[j]&(1<<i))?(1<<pos[i]):0);
		}
		a[j]=ret;
	}
	//for(LL j=1;j<=n;++j) printf("%d ",a[j]); puts("");
	LL up((1<<tot)-1);
	C[0][0]=1;
	for(LL i=1;i<=n;++i){
		C[i][0]=1;
		for(LL j=1;j<=i;++j){
			C[i][j]=C[i-1][j-1]+C[i-1][j];
		}
	}
	for(LL i=1;i<=n;++i){
		for(LL j=1;j<=K;++j) g[i]+=C[i][j];
	}
	for(LL i=1;i<=up;++i){
		lg[i]=lg[i-(i&-i)]+1;
	}
	LL ans(0);
	for(LL i=0;i<=up;++i){
		for(LL j=1;j<=n;++j){
			if(vis[j]) continue;
			f[a[j]&i]++;
		}
		LL ret(0);
		for(LL j=1;j<=n;++j){
			LL tmp(a[j]&i);
			ret+=g[f[tmp]];
			f[tmp]=0;
		}
		if(lg[i]&1) ans-=ret;
		else ans+=ret;
	}
	printf("%lld\n",ans);
	return 0;
}