#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
int a[maxn][maxn];
int main() {
  int n, m;
  cin >> n >> m;
  if (n == 1 && m == 1) {
    cout << "1" << endl;
    return 0;
  }
  if (n + m < 5) {
    cout << "-1" << endl;
    return 0;
  }
  int r = (n * m) / 2 + 1;
  int l = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if ((i + j) % 2 == 0)
        cout << r++ << " ";
      else
        cout << l++ << " ";
    }
    cout << endl;
  }
  return 0;
}
