#include #include #include using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 1000000000 int main(){ int N,M; cin>>N>>M; vector X(N); rep(i,N){ X[i] = 0; rep(j,M){ int t; cin>>t; X[i] |= (1< dp(1<>k)&1)c++; } if(c!=i)continue; vector ok(M,0); rep(k,N){ if((X[k]&j)!=j)continue; rep(l,M){ if((X[k]>>l)&1)ok[l]++; else ok[l]--; } } rep(k,M){ if((j>>k)&1)continue; if(ok[k]<0)continue; dp[j|(1<