#include using namespace std; using LL=long long; using ULL=unsigned long long; #define rep(i,n) for(int i=0;i<(n);i++) const LL M=998244353; const int Z=1024; int N,K,X,Y; int A[Z]={}; LL dp[Z][Z]; LL buf[Z][Z]; int main(){ cin>>N>>K>>X>>Y; rep(i,K){ int a; cin>>a; A[a]=dp[a][a]=1; } rep(i,N-1){ rep(x,Z){ LL S=0; rep(y,Z) S+=dp[x][y]; rep(y,Z){ if(!A[y]) continue; buf[x^y][y] = S-dp[x][y]; } } rep(x,Z) rep(y,Z){ dp[x][y]=buf[x][y]; buf[x][y]=0; } } LL ans=0; rep(x,Z) rep(y,Z) if(X<=x && x<=Y) ans+=dp[x][y]; ans%=M; cout<