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

x_array = [0,1].repeated_permutation(n).to_a.map{|ele| ele.size.times.select{|i| 1 == ele[i]}}
count = 0
x_array.each do |x_comb|
  judge = false
  (0..(m - 1)).each do |y|
    x_comb.each do |x|
      if table[x][y] == 1
        judge = true
        break
      end
    end
    if judge == true
      break
    end
  end
  count += 1 if judge == true
end

puts (count * (2 ** (m - 1))) % 998244353