#include <iostream>
#include <cstring>
using namespace std;
typedef long long ll;
const int MOD = 998244353;
const int N=105, M=2005;
int n, m, a[N][M], hm;
int sum[N], f[N][2*N];
ll ans=1;
void init() {
for(int i=1; i<=n; i++)
for(int j=0; j<=2*n; j++)
f[i][j] = 0;
}
int main() {
cin>>n>>m;
for(int i=1; i<=n; i++) {
sum[i] = 0;
for(int j=1; j<=m; j++) {
cin>>a[i][j];
sum[i] = (sum[i]+1LL*a[i][j])%MOD;
}
ans = (ans * (sum[i]+1))%MOD;
}
for(int c=1; c<=m; c++) {
init();
}
cout<<(ans-1+MOD)%MOD<<endl;
return 0;
}