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