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>
using namespace std;
using Int = long long;
Int memo[55][55];
Int comb(int n, int r) {
    if (n < r) return 0;
    if (memo[n][r] > 0) return memo[n][r];
    if (r == 0 || r == n) return memo[n][r] = 1;
    return memo[n][r] = comb(n - 1, r - 1) + comb(n - 1, r);
}
Int solve2(int K, int B, const vector<int> &A) {
    vector<Int> ary(1 << B);
    vector<Int> F(A.size() + 1);
    for (int i = 1; i <= A.size(); i++) {
        for (int j = 1; j <= K; j++) F[i] += comb(i, j);
    }
    for (int i = 0; i < (1 << B); i++) {
        map<int, int> M;
        for (auto a : A) M[a & i]++;
        for (auto &p : M) ary[i] += F[p.second];
    }
    Int ans = 0;
    for (int i = 0; i < (1 << B); i++) {
        ans += (__builtin_popcount(i) % 2 == 0 ? +1 : -1) * ary[i];
    }
    return ans;
}
Int solve(int K, int S, int T, const vector<int> &A) {
    vector<int> B;
    for (auto a : A) {
        if ((a & S) != S) continue;
        if ((a & ~T) != 0) continue;
        B.push_back(a);
    }
    T &= ~S;
    for (auto &b : B) {
        int j = 0, k = 0;
        for (int i = 0; i < 18; i++) if ((1 << i) & T) {
            k |= !!(b & (1 << i)) << j;
            j++;
        }
        b = k;
    }
    return solve2(K, __builtin_popcount(T), B);
}
int main() {
    int N, K, S, T; cin >> N >> K >> S >> T;
    vector<int> A(N); for (auto &a : A) cin >> a;
    cout << solve(K, S, T, A) << '\n';
    return 0;
}