n,m = gets.split.map(&:to_i)
table = []
(1..n).each do |i|
  table << gets.split.map(&:to_i)
end

combi = []
count = 0
(1..(2 ** n - 1)).each do |i|
  i = i.to_s(2)
  x_len = i.length - 1
  x_array = i.split("").map.with_index{|e,i| e == "1" ? x_len - i : nil}.compact
    (1..(2 ** m - 1)).each do |j|
      j = j.to_s(2)
      y_len = j.length - 1
      y_array = j.reverse.split("").map.with_index{|e,i| e == "1" ? y_len - i : nil}.compact
      combi << [x_array,y_array]
    end
end

combi.each do |pair|
  sum = 0
  pair[0].each do |x|
    pair[1].each do |y|
      sum += table[x][y].to_i
    end
  end
  count += 1 if sum % 2 == 1
end

puts count % 998244353