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>
using namespace std;
#define ll long long
#define ull unsigned long long
const int MAXN=262144,MAXM=30000000;
int P;
#define L 1048576
#define real long double
#define eps 1e-9
char _buf[L],*S,*T,_buf1[L],*S1=_buf1;
inline char gc()
{
	if(S==T)
	{
		T=(S=_buf)+fread(_buf,1,L,stdin);
		if(S==T)return 0;
	}
	return *S++;
}
template<class T> void get(T &x)
{
	char c;
	for(c=gc();(c<'0'||c>'9')&&c!='-';c=gc());
	bool b=0;
	if(c=='-')
	{
		b=1;
		c=gc();
	}
	for(x=c^'0',c=gc();c>='0'&&c<='9';c=gc())x=(x<<3)+(x<<1)+(c^'0');
	if(b)x=-x;
}
inline void pc(char c)
{
	if(S1==_buf1+L)
	{
		fwrite(_buf1,1,L,stdout);
		S1=_buf1;
	}
	*S1++=c;
}
void out(ll x)
{
	if(x>9)out(x/10);
	pc(x%10^'0');
}
int Pow(int x,int y)
{
	int s=1;
	for(;y;y>>=1,x=(ll)x*x%P)if(y&1)s=(ll)s*x%P;
	return s;
}
int A(int x)
{
	return x<0?-x:x;
}
int n,N,m,s,t,i,j,a[50],o[1048576];
long long d[20][2],f[50],ans,c[55][55];
int O(ll x)
{
	return o[x>>40]+o[x>>20&1048575]+o[x&1048575];
}
void dfs(int x,ll y,int w)
{
	if(!y)return;
	if(x==18)
	{
		f[O(y)]+=w;
		return;
	}
	dfs(x+1,y,w);
	if(t>>x&1)
	{
		dfs(x+1,y&d[x][0],-w);
		dfs(x+1,y&d[x][1],-w);
	}
}
int main()
{
	for(i=1;i<1<<20;i++)o[i]=o[i>>1]+(i&1);
	get(n);
	get(m);
	get(s);
	get(t);
	if((t&s)!=s)
	{
		puts("0");
		return 0;
	}
	while(n--)
	{
		get(i);
		if((i&s)==s&&!(i&~t))a[N++]=i^s;
	}
	t^=s;
	for(i=0;i<18;i++)if(t>>i&1)for(j=0;j<N;j++)d[i][a[j]>>i&1]|=1LL<<j;
	for(i=c[0][0]=1;i<=N;i++)for(j=c[i][0]=1;j<=i;j++)c[i][j]=c[i-1][j]+c[i-1][j-1];
	dfs(0,(1LL<<N)-1,1);
	for(i=1;i<=N;i++)for(j=1;j<=m;j++)ans+=f[i]*c[i][j];
	cout<<ans<<endl;
	fwrite(_buf1,1,S1-_buf1,stdout);
	return 0;
}