#include <bits/stdc++.h>
#define rep(i, x, y) for (int i = x; i <= y; i++)
using namespace std;

typedef long long ll;
const int N = 1e5 + 10, M = (1 << 20) + 2;
int n, m, a[N], cnt[N];
char s[N][22];

int main() {
    cin >> n >> m;
    rep(i, 1, n) {
        scanf("%s", s[i]);
        rep(j, 0, m - 1) {
            a[i] = (a[i] << 1) + s[i][j] - '0';
        }
        ++cnt[__builtin_popcount(a[i]) & 1];
    }
    printf("%lld\n", 1ll * cnt[0] * cnt[1]);
    return 0;
}
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <functional>

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353

typedef long long ll;
typedef pair<ll,ll> P;

long long mod_div(long long a,long long b){
	long long tmp = MOD - 2,c = b,ret = 1;
	while(tmp > 0){
		if(tmp & 1){
			ret *= c;ret %= MOD;
		}
		c *= c;c %= MOD;tmp >>= 1;
	}
	return a*ret%MOD;
}

int main(){
	cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);

	ll n, m;cin >> n >> m;

	vector<bool> no_prime(m);
	vector<ll> primes;
	for(int i = 2;i * i <= m;i++) {
		if(no_prime[i])continue;
		primes.PB(i);
		for(ll j = 2 * i;j <= m;j += i)no_prime[j] = true;
	}
	vector<ll> kai(202020, 1);
	vector<ll> inv(202020, 1);
	for(ll i = 1;i < 202020;i++) {
		kai[i] = kai[i-1] * i % MOD;
		inv[i] = mod_div(1, kai[i]);
	}


	ll ans = 0;
	for(ll i = 1;i <= m;i++) {
		ll now = 1;
		ll tmp = i;
		for(ll ele: primes) {
			if(ele > i)break;
			int cou = 0;
			while(tmp % ele == 0) {
				tmp /= ele;
				cou++;
			}
			now = (now * kai[(n-1) + cou]) % MOD;
			now = (now * (inv[n-1] * inv[cou] % MOD)) % MOD;
		}

		if(tmp > 1) {
			now = (now * kai[(n-1) + 1]) % MOD;
			now = (now * (inv[n-1] * inv[1] % MOD)) % MOD;
		}

		// cout << "tmp: " << i << " " << now << endl;
		ans = (ans + now) % MOD;
	}

	cout << ans << endl;
	// SHOW1d(primes, primes.size());

	return 0;
}
