#include <bits/stdc++.h>

using namespace std;

template<typename T, T MOD>
struct ModType {
    using Int = T;
    static constexpr Int mod = MOD;
    Int v;

    ModType(long long _v = 0) : v(set(_v)) {}
    ModType(const ModType &r) : v(set(r.v)) {}

    inline static Int set(const Int x) { return x < 0 ? (x % mod) + mod : x % mod; }
    inline void set() { v = set(v); }

    bool operator<(ModType r) const { return v < r.v; }
    bool operator>(ModType r) const { return r.v < v; }
    bool operator==(ModType r) const { return v == r.v; }
    bool operator!= (ModType r) const { return v != r.v; }

    ModType operator-() const { return ModInt(v ? mod - v : v); }
    ModType &operator=(const ModType &r) { if (this != &r) v = set(r.v); return *this; }
    ModType &operator+=(ModType r) { (v += r.v) %= mod; return *this; }
    ModType &operator-=(ModType r) { (v -= r.v - mod) %= mod; return *this; }
    // ModType &operator*=(ModType r) { v = (__uint128_t(v) * r.v) % mod; return *this; }
    ModType &operator*=(ModType r) { v = 1ULL * v * r.v % mod; return *this; }
    ModType &operator/=(ModType r) { *this *= r.inv(); return *this; }
    ModType operator+(ModType r) const { return ModType(*this) += r; }
    ModType operator-(ModType r) const { return ModType(*this) -= r; }
    ModType operator*(ModType r) const { return ModType(*this) *= r; }
    ModType operator/(ModType r) const { return ModType(*this) /= r; }

    ModType inv() const {
        long long a = v, b = mod, u = 1, w = 0;
        while (b) {
            long long t = a / b;
            std::swap(a -= t * b, b);
            std::swap(u -= t * w, w);
        }
        return ModType(u);
    }

    ModType pow(Int e) {
        ModType a = *this, x(1);
        for ( ; 0 < e; e >>= 1) { if (e & 1) x *= a; a *= a; }
        return x;
    }
    inline ModType pow(ModType &e) { return pow(e.v); }

    friend std::ostream &operator<<(std::ostream &os, const ModType &r) { return os << r.v; }
    friend std::istream &operator>>(std::istream &is, ModType &r) {
        is >> r.v; r.set();return is;
    }

    static std::vector<ModType> Inverse(const Int n = mod - 1) {
        std::vector<ModType> inv(n + 1);
        inv[1].v = 1;
        for (Int a = 2; a <= n; ++a)
            inv[a] = inv[mod % a] * T(mod - mod / a);
        return inv;
    }
};

using ModInt = ModType<int, 1000000007>;

using Mod2 = ModType<int, 2>;
using Type = ModType<long long, 998244353>;
using Vector = vector<Mod2>;
using Matrix = vector<Vector>;

int Rank(Matrix &A) {
    const int N = A.size(), M = A[0].size();
    int rank = 0;
    vector<bool> used(N, false);

    for (int c = 0; c < M; ++c) {
        int pivot = 0;
        while (pivot < N && (used[pivot] || A[pivot][c] == 0)) ++pivot;
        if (pivot == N) continue;

        ++rank;
        used[pivot] = true;
        Mod2 v = A[pivot][c];
        for (int j = 0; j < M; ++j) A[pivot][j] /= v;
        for (int r = 0; r < N; ++r) {
            if (r == pivot) continue;
            for (int j = c + 1; j < M; ++j)
                A[r][j] -= A[r][c] * A[pivot][j];
        }
    }

    return rank;
}

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

    int n, m;
    cin >> n >> m;
    Matrix A(n, Vector(m));
    for (int i = 0; i < n; ++i)
        for (int j = 0; j < m; ++j)
            cin >> A[i][j];

    int rank = Rank(A);
    Type res = Type(2).pow(m + n - 1) - Type(2).pow(m + n - rank - 1);
    cout << res << endl;

    return 0;
}


Measured memory_bytes: 640