#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  if (n == 1 && m == 1)
    cout << 1;
  else if (m + n < 5)
    cout << -1;
  else {
    int x = n * m / 2 + 1, y = 1;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        if ((i + j) % 2 == 0) {
          cout << x << ' ';
          x++;
        } else {
          cout << y << " ";
          y++;
        }
      }
      cout << endl;
    }
  }
  return 0;
}
