n,m = gets.split.map(&:to_i)
table = []
(1..n).each do |n|
  table.push(gets.split.map(&:to_i))
end
combi = []
count = 0
(1..(2 ** n - 1)).each do |i|
  x_array = i.to_s(2).split("")
    (1..(2 ** m - 1)).each do |j|
      y_array = j.to_s(2).split("")
      combi.push([x_array,y_array])
    end
end
 
combi.each do |pair|
  sum = 0
  x_num = -1
  pair[0].reverse_each do |x|
    y_num = -1
    x_num += 1
    next if x == "0"
    pair[1].reverse_each do |y|
      y_num += 1
      next if y == "0"
 
      sum += table[x_num][y_num].to_i
    end
  end
  count += 1 if sum % 2 == 1
end
 
puts count % 998244353