#!/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)] c[0][0] = 1 for _ in range(n): d = [[0] * m for _ in range(m)] for u in a: for i in range(m): if i == u: continue for j in range(m): d[u][j ^ u] = (d[u][j ^ u] + c[i][j]) % MOD c = d ans = 0 for i in range(x, min(y + 1, m)): for u in a: ans = (ans + c[u][i]) % MOD print(ans)