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