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