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