#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,a,b) for(int i=(a),_end_=(b);i<=_end_;i++)
#define DREP(i,a,b) for(int i=(a),_end_=(b);i>=_end_;i--)
#define EREP(i,a) for(int i=start[(a)];i;i=e[i].next)
template<class T>inline void chkmax(T &a,T b){ if(a<b)a=b;}
template<class T>inline void chkmin(T &a,T b){ if(a>b)a=b;}
#define fi first
#define se second
#define mkr(a,b) make_pair(a,b)
inline int read()
{
	int sum=0,p=1;char ch=getchar();
	while(!(('0'<=ch && ch<='9') || ch=='-'))ch=getchar();
	if(ch=='-')p=-1,ch=getchar();
	while('0'<=ch && ch<='9')sum=sum*10+ch-48,ch=getchar();
	return sum*p;
}

const int mod=998244353;
const int maxn=320;

inline int power(int a,int b)
{
	int ans=1;
	while(b)
	{
		if(b&1)ans=(ll)ans*a%mod;
		b>>=1;
		a=(ll)a*a%mod;
	}
	return ans;
}

int a[maxn][maxn],n,m;
bitset<320>b[maxn];
bitset<320>s[maxn];int vis[maxn];

inline void insert(bitset<320> x)
{
	DREP(i,m,1)if(x[i])
	{
		if(!vis[i]){ s[i]=x;vis[i]=1; break;}
		else x^=s[i];
	}
}

inline void init()
{
	n=read();m=read();
	REP(i,1,n)REP(j,1,m)a[i][j]=read();
	REP(j,1,m)
	{
		int s=0;
		REP(i,1,n)s+=a[i][j];
		//if(s&1)REP(i,1,n)a[i][j]^=1;
	}
	REP(i,1,n)REP(j,1,m)if(a[i][j])b[i].set(j);
	REP(i,1,n)
	{
		insert(b[i]);
	}
}

inline void doing()
{
	int ss=0; REP(i,1,m)ss+=vis[i];
	int ans=(ll)(power(2,n)-power(2,n-ss)+mod)*power(2,m-1)%mod;
	printf("%d\n",ans);
}

int main()
{
	init();
	doing();
	return 0;
}


### Prompt

In Cpp, your task is to solve the following problem:

There is a square grid with N rows and M columns. Each square contains an integer: 0 or 1. The square at the i-th row from the top and the j-th column from the left contains a_{ij}.

Among the 2^{N+M} possible pairs of a subset A of the rows and a subset B of the columns, find the number of the pairs that satisfy the following condition, modulo 998244353:

* The sum of the |A||B| numbers contained in the intersection of the rows belonging to A and the columns belonging to B, is odd.

Constraints

* 1 \leq N,M \leq 300
* 0 \leq a_{i,j} \leq 1(1\leq i\leq N,1\leq j\leq M)
* All values in input are integers.

Input

Input is given from Standard Input in the following format:


N M
a_{11} ... a_{1M}
:
a_{N1} ... a_{NM}


Output

Print the number of the pairs of a subset of the rows and a subset of the columns that satisfy the condition, modulo 998244353.

Examples

Input

2 2
0 1
1 0


Output

6


Input

2 3
0 0 0
0 1 0


Output

8

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,a,b) for(int i=(a),_end_=(b);i<=_end_;i++)
#define DREP(i,a,b) for(int i=(a),_end_=(b);i>=_end_;i--)
#define EREP(i,a) for(int i=start[(a)];i;i=e[i].next)
template<class T>inline void chkmax(T &a,T b){ if(a<b)a=b;}
template<class T>inline void chkmin(T &a,T b){ if(a>b)a=b;}
#define fi first
#define se second
#define mkr(a,b) make_pair(a,b)
inline int read()
{
	int sum=0,p=1;char ch=getchar();
	while(!(('0'<=ch && ch<='9') || ch=='-'))ch=getchar();
	if(ch=='-')p=-1,ch=getchar();
	while('0'<=ch && ch<='9')sum=sum*10+ch-48,ch=getchar();
	return sum*p;
}

const int mod=998244353;
const int maxn=320;

inline int power(int a,int b)
{
	int ans=1;
	while(b)
	{
		if(b&1)ans=(ll)ans*a%mod;
		b>>=1;
		a=(ll)a*a%mod;
	}
	return ans;
}

int a[maxn][maxn],n,m;
bitset<320>b[maxn];
bitset<320>s[maxn];int vis[maxn];

inline void insert(bitset<320> x)
{
	DREP(i,m,1)if(x[i])
	{
		if(!vis[i]){ s[i]=x;vis[i]=1; break;}
		else x^=s[i];
	}
}

inline void init()
{
	n=read();m=read();
	REP(i,1,n)REP(j,1,m)a[i][j]=read();
	REP(j,1,m)
	{
		int s=0;
		REP(i,1,n)s+=a[i][j];
		//if(s&1)REP(i,1,n)a[i][j]^=1;
	}
	REP(i,1,n)REP(j,1,m)if(a[i][j])b[i].set(j);
	REP(i,1,n)
	{
		insert(b[i]);
	}
}

inline void doing()
{
	int ss=0; REP(i,1,m)ss+=vis[i];
	int ans=(ll)(power(2,n)-power(2,n-ss)+mod)*power(2,m-1)%mod;
	printf("%d\n",ans);
}

int main()
{
	init();
	doing();
	return 0;
}


```