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