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
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
using ll = long long;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007;
// const int MOD = 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
const int dy8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dx8[] = {0, -1, -1, -1, 0, 1, 1, 1};
template <typename T, typename U> inline bool chmax(T &a, U b) { return a < b ? (a = b, true) : false; }
template <typename T, typename U> inline bool chmin(T &a, U b) { return a > b ? (a = b, true) : false; }
struct IOSetup {
  IOSetup() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} iosetup;

template <typename T>
vector<vector<T>> pascal(int val) {
  vector<vector<T>> c(val + 1, vector<T>(val + 1, 0));
  REP(i, val + 1) {
    c[i][0] = 1;
    FOR(j, 1, i + 1) c[i][j] = c[i - 1][j - 1] + c[i - 1][j];
  }
  return c;
}

int main() {
  int n, k, s, t; cin >> n >> k >> s >> t;
  vector<int> a;
  while (n--) {
    int ai; cin >> ai;
    if ((ai & s) != s || (ai | t) != t) continue;
    int bit = 0, b = 0;
    REP(i, 18) {
      if (!(s >> i & 1) && (t >> i & 1)) b |= (ai >> i & 1) << (bit++);
    }
    a.emplace_back(b);
  }
  n = a.size();
  int l = 0;
  REP(i, 18) {
    if (!(s >> i & 1) && (t >> i & 1)) ++l;
  }
  vector<vector<ll>> c = pascal<ll>(n);
  ll ans = 0;
  REP(bit, 1 << l) {
    map<int, int> mp;
    REP(i, n) ++mp[a[i] & bit];
    for (auto [ignore, cnt] : mp) {
      // cout << bit << ' ' << cnt << '\n';
      for (int i = 1; i <= k && i <= cnt; ++i) ans += c[cnt][i] * (__builtin_popcount(bit) & 1 ? -1 : 1);
    }
  }

  cout << ans << '\n';
  return 0;
}
