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
//Link : https://codeforces.com/contest/1253

#include <bits/stdc++.h>
using namespace std;
#define ll long long
/*
#include <limits.h>
INT_MAX
LLONG_MAX
*/
#define B 18
#define BIT (1<<B)

int cc[BIT],parity[BIT];
#define N 105

ll combi[N][N], csum[N][N];
void solve() {
  int n,k,s,t;
  scanf("%d %d %d %d ", &n,&k,&s,&t);
  if((t&s)!=s) {
    printf("0\n");
    return;
  }
  for(int i=0;i<N;++i) {
    combi[i][0] = 1;
    for(int j=1;j<i;++j) {
      combi[i][j] = combi[i-1][j] + combi[i-1][j-1];
    }
    combi[i][i] = 1;
    for(int j=1;j<N;++j) {
      csum[i][j] = csum[i][j-1] + combi[i][j];
    }
  }
  vector<int> in;
  for(int i=0;i<n;++i) {
    int a;
    scanf("%d ", &a);
    if( ((a&s) ==s )&& ( (t&a) ==a) ) {
      in.push_back(a^s);
    }
  }
  t^=s;
  int tb = 0;
  for(int b=0;b<B;++b) {
    if(t&(1<<b)) {
      ++tb;
    }
  }
  for(int i=0;i<in.size();++i) {
    int sum = 0, cur = 1;
    for(int b=0;b<B;++b) {
      if(in[i]&(1<<b)) {
        sum += cur;
      }
      if(t&(1<<b)) {
        cur = cur*2;
      }
    }
    in[i] = sum;
  }
  ll ret = 0;
  for(int bit=0;bit<(1<<tb);++bit) {
    parity[bit] = parity[bit/2];
    if(bit&1) {
      parity[bit] ^= 1;
    }
    ll sum = 0;
    for(int a : in) {
      sum -= csum[cc[(bit&a)]][min(cc[(bit&a)],k)];
      ++cc[bit&a];
      sum += csum[cc[(bit&a)]][min(cc[(bit&a)],k)];
    }
    for(int a : in) {
      --cc[bit&a];
    }
    if(parity[bit]) {
      sum *= -1;
    }
    ret += sum;
  }
  printf("%lld\n", ret);
}

int main() {
  //freopen("input.txt","r",stdin);
  solve();
  return 0;
}
