n, m = gets.split.map(&:to_i)
as = n.times.map do
  gets.split(nil, m).map(&:to_i)
end

result = 0
(1..n).each do |i|
  (1..m).each do |j|
    (1..n).to_a.combination(i).each do |n_range|
      (1..m).to_a.combination(j).each do |m_range|
        sum = 0
        n_range.each do |k|
          m_range.each do |l|
            sum += as[k-1][l-1]
          end
        end
        result += sum if sum.odd?
      end
    end
  end
end

puts result % 998_244_353
