1 #include<cstdio>
2 #include<cstdlib>
3 #include<cmath>
4 #include<cstring>
5 #include<algorithm>
6 #include<iostream>
7 #include<vector>
8 #include<map>
9 #include<set>
10 #include<queue>
11 #include<string>
12 #define inf 1000000000
13 #define maxn 13
14 #define maxm 500+100
15 #define eps 1e-10
16 #define ll long long
17 #define pa pair<int,int>
18 #define mod 100000000
19 using namespace std;
20 inline int read()
21 {
22 int x=0,f=1;char ch=getchar();
23 while(ch<‘0‘||ch>‘9‘){if(ch==‘-‘)f=-1;ch=getchar();}
24 while(ch>=‘0‘&&ch<=‘9‘){x=10*x+ch-‘0‘;ch=getchar();}
25 return x*f;
26 }
27 int n,m,f[maxn][1<<maxn];
28 int main()
29 {
30 freopen("input.txt","r",stdin);
31 freopen("output.txt","w",stdout);
32 n=read();m=read();
33 f[0][0]=1;
34 for(int i=1;i<=n;i++)
35 {
36 int x,y=0;
37 for(int j=1;j<=m;j++){x=read();if(!x)y+=1<<(j-1);}
38 for(int j=0;j<1<<m;j++)
39 if(!(j&(j<<1))&&!(j&y))
40 for(int k=0;k<1<<m;k++)
41 if(!(j&k))
42 f[i][j]+=f[i-1][k],f[i][j]%=mod;
43 }
44 int ans=0;
45 for(int i=0;i<1<<m;i++)ans+=f[n][i],ans%=mod;
46 printf("%d\n",ans);
47 return 0;
48 }