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>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define SZ(x) ((int)x.size())
#define FOR(i,a,b) for (int i=a;i<=b;++i)
#define FORD(i,a,b) for (int i=a;i>=b;--i)
using namespace std;
typedef long long LL;
typedef pair<int,int> pa;
typedef vector<int> vec;
void getint(int &v){
    char ch,fu=0;
    for(ch='*'; (ch<'0'||ch>'9')&&ch!='-'; ch=getchar());
    if(ch=='-') fu=1, ch=getchar();
    for(v=0; ch>='0'&&ch<='9'; ch=getchar()) v=v*10+ch-'0';
    if(fu) v=-v;
}
int pc[500010],FULL;
LL C[55][55],ans;
int n,K,S,T,m,a[500010];
int main(){
	pc[0]=0;
	FOR(i,1,500000) pc[i]=pc[i>>1]+(i&1);
	C[0][0]=1;
	FOR(i,1,50){
		C[i][0]=1;
		FOR(j,1,i) C[i][j]=(C[i-1][j]+C[i-1][j-1]);
	}
	FOR(i,0,50)
		FOR(j,1,50) C[i][j]+=C[i][j-1];
	cin>>n>>K>>S>>T;
	if ((S&T)!=S) return puts("0"),0;
	FOR(i,1,n){
		int x;
		scanf("%d",&x);
		if ((S&x)!=S) continue;
		if ((x&T)!=x) continue;
		a[++m]=x;
	}
	n=m;
	FULL=(1<<18)-1;
	FOR(i,1,n){
		int nd=S^T;
		FOR(j,0,FULL) if ((j&nd)==j){
			int t=0;
			FOR(k,i+1,n) if ( ( j & (a[k]^a[i])) == 0 ) ++t;
			if (pc[j]&1) (ans-=C[t][K-1]);
			else (ans+=C[t][K-1]);
		}
	}
	cout<<ans<<endl;
	return 0;
}