#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
const double eps = 1e-9;
int f[110][110];
int main() {
  int R, C;
  scanf("%d%d", &R, &C);
  bool sw = false;
  if (R > C) {
    sw = true;
    swap(R, C);
  }
  if (C >= 4) {
    for (int i = (0); i < (C); i++) {
      int id = i * 2 + 1;
      if (id >= C) {
        id -= C;
        if ((C & 1) == 0) --id;
      }
      f[0][id] = i + 1;
    }
    for (int r = (1); r < (R); r++)
      for (int c = (0); c < (C); c++) f[r][c] = f[r - 1][c] + C;
  } else if (C == 3) {
    if (R == 1) {
      printf("-1");
      return 0;
    }
    if (R == 2) {
      f[0][0] = 3;
      f[0][1] = 6;
      f[0][2] = 2;
      f[1][0] = 5;
      f[1][1] = 1;
      f[1][2] = 4;
    } else {
      f[0][0] = 1;
      f[0][1] = 6;
      f[0][2] = 2;
      f[1][0] = 7;
      f[1][1] = 3;
      f[1][2] = 8;
      f[2][0] = 4;
      f[2][1] = 9;
      f[2][2] = 5;
    }
  } else if (C == 2) {
    printf("-1");
    return 0;
  } else {
    printf("1");
    return 0;
  }
  if (sw) {
    for (int c = (0); c < (C); c++) {
      printf("%d", f[0][c]);
      for (int r = (1); r < (R); r++) printf(" %d", f[r][c]);
      printf("\n");
    }
  } else {
    for (int r = (0); r < (R); r++) {
      printf("%d", f[r][0]);
      for (int c = (1); c < (C); c++) printf(" %d", f[r][c]);
      printf("\n");
    }
  }
  return 0;
}
