#include <bits/stdc++.h>
using namespace std;
int main() {
  long long mass[100][100] = {0}, n, m, i, j, q, w;
  cin >> n >> m;
  if (n * m == 1) {
    cout << 1;
    return 0;
  }
  if ((n * m < 4) || (n == 2 && m == 2)) {
    cout << -1;
    return 0;
  }
  w = n * m;
  q = w / 2;
  if ((n * m) % 2 != 0) q++;
  for (j = 0; j < m; j++)
    for (i = 0; i < n; i++)
      if ((i + j) % 2 == 0) {
        mass[i][j] = q;
        q--;
      }
  for (i = 0; i < m; i++)
    for (j = 0; j < n; j++)
      if ((i + j) % 2 != 0) {
        mass[j][i] = w;
        w--;
      }
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) cout << mass[i][j] << ' ';
    cout << endl;
  }
  return 0;
}
