#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  for (; ~scanf("%d%d", &n, &m);) {
    if (n == 1) {
      if (m == 1)
        puts("0");
      else {
        for (int i = 1; i <= m; ++i) printf("%d ", i + 1);
        puts("");
      }
    } else {
      if (m == 1)
        for (int i = 1; i <= n; ++i) printf("%d\n", i + 1);
      else
        for (int i = 1; i <= n; ++i) {
          for (int j = 1; j <= m; ++j) printf("%d ", i * (j + n));
          puts("");
        }
    }
  }
  return 0;
}
