#include <bits/stdc++.h>
using namespace std;
int main() {
  long i, j, r, c;
  cin >> r >> c;
  if (r == 1 && c == 1)
    cout << "0";
  else if (c == 1) {
    for (i = 2; i <= r + 1; i++) cout << i << endl;
  } else {
    for (i = 1; i <= r; i++) {
      for (j = 1; j <= c; j++) {
        cout << i * (j + r) << " ";
      }
      cout << endl;
    }
  }
}
