using System; using System.Linq; class A { const long M = 998244353; static int[] Read() => Array.ConvertAll(Console.ReadLine().Split(), int.Parse); static (int, int, int, int) Read4() { var a = Read(); return (a[0], a[1], a[2], a[3]); } static void Main() { var (n, k, x, y) = Read4(); var a = Read(); a = a.Distinct().ToArray(); k = a.Length; var dp = NewArray2(n + 1, 1 << 10); dp[0][0] = 1; foreach (var v in a) dp[1][v] = 1; for (int i = 0; i < k; i++) { for (int j = i + 1; j < k; j++) { dp[2][a[i] ^ a[j]] += 2; } } for (int i = 2; i < n; i++) { for (int j = 0; j < 1 << 10; j++) { if (dp[i][j] == 0) continue; foreach (var v in a) { var nv = j ^ v; dp[i + 1][nv] += dp[i][j] - dp[i - 1][nv]; dp[i + 1][nv] %= M; } } } Console.WriteLine(dp[n][x..(y + 1)].Sum() % M); } static T[][] NewArray2(int n1, int n2, T v = default) => Array.ConvertAll(new bool[n1], _ => Array.ConvertAll(new bool[n2], __ => v)); }