#include //#include #pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") //namespace mp = boost::multiprecision; //using Bll = mp::cpp_int; using namespace std; #define ll long long #define rep(i, m, n) for (ll i = m; i < n; i++) #define rrep(i, m, n) for (ll i = m - 1; i >= n; i--) #define pb(n) push_back(n) #define UE(N) N.erase(unique(N.begin(), N.end()), N.end()); #define Sort(n) sort(n.begin(), n.end()) #define Rev(n) reverse(n.begin(), n.end()) #define HpOut(S) cout << setprecision(50) << S << endl #define Vec(K, L, N, S) vector K(N, S) #define DV(K, L, N, M, S) vector> K(N, vector(M, S)) #define TV(K, L, N, M, R, S) \ vector>> K(N, vector>(M, vector(R, S))) #define pint pair #define tint tuple #define paf(L, R) pair #define mod 998244353 #define MAX 10010 #define ALL(a) a.begin(), a.end() #define chmax(a, b) a = (((a) < (b)) ? (b) : (a)) #define chmin(a, b) a = (((a) > (b)) ? (b) : (a)) ll N, K; vector A; map ans; void dfs(ll cnt, ll x, ll prev) { if(!cnt) ans[pint(x, prev)]++; else { rep(i, 0, K) { if(A[i] == prev) continue; dfs(cnt - 1, x ^ A[i], A[i]); } } } int main() { ios::sync_with_stdio(false); cin.tie(0); ll X, Y; cin >> N >> K >> X >> Y; A.resize(K); rep(i, 0, K) cin >> A[i]; Sort(A), UE(A); K = A.size(); ll L = N / 2; dfs(L, 0, -1); ll res = 0; for(auto v : ans) for(auto w : ans) { if(v.first.second == w.first.second) continue; ll z = v.first.first ^ w.first.first; if(X <= z && z <= Y) res = (res + v.second * w.second % mod) % mod; } cout << res % mod << endl; }