# 题意

$1\le n\le 50,0\le k,{m}_{1},{m}_{2}\dots {m}_{n}\le {2}^{31}-1$$1\le n\le50,0\le k,m_1,m_2…m_n\le2^{31}-1$

# 代码

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>

typedef long long LL;

const int N=55;
const int MOD=1000000003;

int n,m,bin[25],f[N][2],a[N];

int main()
{
bin[0]=1;
for (int i=1;i<=30;i++) bin[i]=bin[i-1]*2;
scanf("%d%d",&n,&m);
while (n||m)
{
for (int i=1;i<=n;i++) scanf("%d",&a[i]);
int ans=0;
for (int i=30;i>=0;i--)
{
for (int j=1;j<=n;j++)
{
if (!(a[j]&bin[i])) continue;
int s=1,c=0;
for (int k=1;k<j;k++) s=(LL)s*(a[k]%bin[i]+1)%MOD,c^=((a[k]&bin[i])>0);
f[j][c]=s;f[j][c^1]=0;
for (int k=j+1;k<=n;k++)
if (a[k]&bin[i])
{
f[k][0]=((LL)f[k-1][1]*(a[k]%bin[i]+1)%MOD+(LL)f[k-1][0]*bin[i]%MOD)%MOD;
f[k][1]=((LL)f[k-1][0]*(a[k]%bin[i]+1)%MOD+(LL)f[k-1][1]*bin[i]%MOD)%MOD;
}
else f[k][0]=(LL)f[k-1][0]*(a[k]%bin[i]+1)%MOD,f[k][1]=(LL)f[k-1][1]*(a[k]%bin[i]+1)%MOD;
if (m&bin[i]) (ans+=f[n][1])%=MOD;
else (ans+=f[n][0])%=MOD;
}
int c=0;
for (int j=1;j<=n;j++) c^=a[j]&bin[i];
if (c!=(m&bin[i])) break;
}
int t=0;
for (int i=1;i<=n;i++) t^=a[i];
if (t==m) (ans+=1)%=MOD;
printf("%d\n",ans);
scanf("%d%d",&n,&m);
}
return 0;
}