#include using namespace std; typedef long long int ll; typedef pair P; typedef vector VI; typedef vector VVI; #define REP(i,n) for(int i=0;i> n >> k >> x >> y; set st; int a; REP(i,k){ cin >> a; st.insert(a); } ll dp[45][1024]={0}; dp[0][0]=1; REP(i,n){ REP(j,1024){ for(int x:st){ REP(k,n){ if(k%2==0) dp[i+1+k][j^x]=(dp[i+1+k][j^x]+dp[i][j])%MOD; else dp[i+1+k][j]=(dp[i+1+k][j]+MOD-dp[i][j])%MOD; } } } } ll ans=0; if(x>=1024){ cout << 0 << endl; } else{ for(int i=x;i<=min(1023,y);i++){ ans=(ans+dp[n][i])%MOD; } cout << ans << endl; } return 0; }