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<vector>
#include<cmath>
#include<map>
#include<cstdlib>
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<set>
#include<stack>
#include<bitset>
#include<functional>
#include<ctime>
#include<queue>
#include<deque>
#include<complex>
#include<cassert>
using namespace std;
#define pb push_back
#define pf push_front
typedef long long lint;
typedef complex<double> P;
#define mp make_pair
#define fi first
#define se second
typedef pair<int,int> pint;
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
//問題文および制約はちゃんと確認しよう！
//サイズは10^5じゃなくて2×10^5とかかもしれないし、重要な制約・条件を見落としているかも
//とりあえずサンプルを読んでから解法を考えよう？
lint co[58][58];
lint cal(vector<int> v,int S,int K){
	int n=v.size();
	lint ret=0;
	rep(i,(1<<18)){
		if((S|i)>S) continue;
		int x=0,t=1;
		if(__builtin_popcount(i)%2>0) t=-1;
		rep(j,n){
			if(!(i&v[j])) x++;
		}
		rep(j,K+1){
			ret+=co[x][j]*t;
		}
	}
	return ret;
}
int a[58];
int main()
{
	memset(co,0,sizeof(co));
	rep(i,55){
		co[i][0]=co[i][i]=1;
		REP(j,1,i) co[i][j]=co[i-1][j]+co[i-1][j-1];
	}
	int n,K,S,T,m=0,x,okm=0;
	cin>>n>>K>>S>>T;
	rep(j,18){
		if((S&(1<<j))!=(T&(1<<j))) okm+=(1<<j);
	}
	rep(i,n){
		cin>>x;
		int f=0;
		rep(j,18){
			if((x&(1<<j)) && !(T&(1<<j))) f=1;
			if(!(x&(1<<j)) && (S&(1<<j))) f=1;
		}
		if(f<1){
			a[m]=x;m++;
		}
	}
	//cout<<m<<endl;rep(i,m) cout<<a[i]<<endl;
	lint out=0;
	rep(i,m){
		vector<int> v;
		REP(j,i+1,m) v.pb(a[i]^a[j]);
		out+=cal(v,S^T,K-1);
	}
	cout<<out<<endl;
}
