import sys input = lambda : sys.stdin.readline().rstrip() sys.setrecursionlimit(max(1000, 10**9)) write = lambda x: sys.stdout.write(x+"\n") n,k,x,y = list(map(int, input().split())) a = list(map(int, input().split())) nn = n//2 from itertools import combinations_with_replacement as cr, product d = [0]*(1025) for vs in product(*[a for _ in range(nn)]): vv = 0 for v in vs: vv ^= v d[vv] += 1 ans = 0 M = 998244353 for i in range(1025): if d[i]==0: continue for j in range(1025): if x<=(i^j)<=y: ans += d[i]*d[j] ans %= M print(ans//nn)