#include <bits/stdc++.h>

#define MOD 998244353

using namespace std;

int pow(int x, int pow) {
	int res = 1, t = x;
	while (pow) {
		if (pow & 1) {
			res = 1LL * res * t % MOD;
		}
		t = 1LL * t * t % MOD;
		pow >>= 1;
	}
	return res;
}

int main() {
	int n, m;
	cin >> n >> m;
	int** mat = new int*[n];
	for (int i = 0; i < n; i++) {
		mat[i] = new int[m];
		for (int j = 0; j < m; j++) {
			cin >> mat[i][j];
		}
	}
	int cur = 0;
	for (int c = 0; cur < n && c < m; c++) {
		for (int r = cur; r < n; r++) {
			if (mat[r][c]) {
				swap(mat[cur], mat[r]);
				break;
			}
		}
		if (!mat[cur][c]) {
			continue;
		}
		for (int r = 0; r < n; r++) {
			if (r != cur && mat[r][c]) {
				for (int k = c; k < m; k++) {
					mat[r][k] ^= mat[cur][k];
				}
			}
		}
		cur++;
	}

	int tot = pow(2, n + m - 1);
	tot -= pow(2, n + m - cur - 1);
	if (tot < 0) {
		tot += MOD;
	}
	cout << tot << endl;

	for (int i = 0; i < n; i++) {
		delete mat[i];
	}
	delete mat;
	return 0;
}
### Prompt

Please create a solution in CPP to 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>

#define MOD 998244353

using namespace std;

int pow(int x, int pow) {
	int res = 1, t = x;
	while (pow) {
		if (pow & 1) {
			res = 1LL * res * t % MOD;
		}
		t = 1LL * t * t % MOD;
		pow >>= 1;
	}
	return res;
}

int main() {
	int n, m;
	cin >> n >> m;
	int** mat = new int*[n];
	for (int i = 0; i < n; i++) {
		mat[i] = new int[m];
		for (int j = 0; j < m; j++) {
			cin >> mat[i][j];
		}
	}
	int cur = 0;
	for (int c = 0; cur < n && c < m; c++) {
		for (int r = cur; r < n; r++) {
			if (mat[r][c]) {
				swap(mat[cur], mat[r]);
				break;
			}
		}
		if (!mat[cur][c]) {
			continue;
		}
		for (int r = 0; r < n; r++) {
			if (r != cur && mat[r][c]) {
				for (int k = c; k < m; k++) {
					mat[r][k] ^= mat[cur][k];
				}
			}
		}
		cur++;
	}

	int tot = pow(2, n + m - 1);
	tot -= pow(2, n + m - cur - 1);
	if (tot < 0) {
		tot += MOD;
	}
	cout << tot << endl;

	for (int i = 0; i < n; i++) {
		delete mat[i];
	}
	delete mat;
	return 0;
}
```