#include <bits/stdc++.h>
using namespace std;
struct abc {
  long long int c, x, y;
};
bool compare(abc a1, abc a2) {
  if (a1.x == a2.x) return a1.y > a2.y;
  return a1.x < a2.x;
}
const long long int mod = 1e9 + 7;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int n, m;
  cin >> n >> m;
  if (n == 1 && m == 1) return cout << 0, 0;
  if (m == 1) {
    long long int k = 2;
    for (long long int i = 1; i <= n; i++) {
      for (long long int j = n + 1; j <= n + m; j++) cout << k++;
      cout << endl;
    }
  } else {
    for (long long int i = 1; i <= n; i++) {
      for (long long int j = n + 1; j <= n + m; j++) cout << i * j << ' ';
      cout << endl;
    }
  }
}
