#include using namespace std; const long long MOD = 998244353; void dfs(vector> &H, vector &A, int r, int prv, int x){ if (r == 0){ H[prv][x]++; } else { int K = A.size(); for (int j = 0; j < K; j++){ if (A[j] != prv){ dfs(H, A, r - 1, A[j], x ^ A[j]); } } } } vector fwt(vector A, int N, bool inv){ for (int i = 0; i < N; i++){ for (int j = 0; j < (1 << N); j++){ if (!(j >> i & 1)){ long long x = A[j]; long long y = A[j | (1 << i)]; A[j] = (x + y) % MOD; A[j | (1 << i)] = (x + MOD - y) % MOD; if (inv){ A[j] *= 499122177; A[j] %= MOD; A[j | (1 << i)] *= 499122177; A[j | (1 << i)] %= MOD; } } } } return A; } vector xor_convolution(vector A, vector B, int N){ A = fwt(A, N, false); B = fwt(B, N, false); vector C(1 << N); for (int i = 0; i < (1 << N); i++){ C[i] = A[i] * B[i] % MOD; } C = fwt(C, N, true); return C; } int main(){ int N, K, X, Y; cin >> N >> K >> X >> Y; vector A(K); for (int i = 0; i < K; i++){ cin >> A[i]; } //sort(A.begin(), A.end()); //A.erase(unique(A.begin(), A.end()), A.end()); vector> H(1024, vector(1024, 0)); dfs(H, A, N / 2, -1, 0); vector sum(1024, 0); for (int i = 0; i < 1024; i++){ for (int j = 0; j < 1024; j++){ sum[j] += H[i][j]; sum[j] %= MOD; } } sum = xor_convolution(sum, sum, 10); long long ans = 0; for (int i = X; i <= Y; i++){ ans += sum[i] % MOD; } ans %= MOD; for (int i = 0; i < 1024; i++){ H[i] = xor_convolution(H[i], H[i], 10); for (int j = X; j <= Y; j++){ ans += MOD - H[i][j] % MOD; } ans %= MOD; } cout << ans << endl; }