#!/usr/bin/env python3 # # No.1304 あなたは基本が何か知っていますか?私は知っています. # import sys, os, math def read_ints(): return list(map(int, input().split())) MOD = 998244353 n, k, x, y = read_ints() a = read_ints() m, mx = 1, max(a) while m <= mx: m <<= 1 c = [[0] * m for _ in range(m)]; s = [0] * m c[0][0] = s[0] = 1 for _ in range(n): d = [[0] * m for _ in range(m)] z = [0] * m for u in a: for i in range(m): d[i ^ u][u] = (d[i ^ u][u] + s[i] - c[i][u] + MOD) % MOD z[i ^ u] += d[i ^ u][u] c = d; s = z ans = 0 for i in range(x, min(y + 1, m)): for u in a: ans = (ans + c[i][u]) % MOD print(ans)