danzhu2022 @ 2024-03-18 21:19:22
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int p[64];
bool insert(ll x)
{
for(int i=63;i>=0;i--)
{
if(!(x>>i))continue;
if(!p[i])
{
p[i]=x;
return 1;
}
else x^=p[i];
}
// if(x)
return 0;
}
int main(){
int n,m;
cin>>n>>m;
ll a;
int cnt=0;
for(int i=1;i<=m;i++)
{
string s;
cin>>s;
a=0;
for(int j=0;j<n;j++)
{
a*=2;
if(s[j]=='O')a++;
}
if(insert(a))cnt++;
}
ll res=1;
while(cnt>0)
{
cnt--;
res=(res*2)%2008;
}
cout<<res;
return 0;
}