#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[n + 2][m + 2];
  int counter = 1;
  for (int i = 1; i <= n; i += 2) {
    for (int j = 1; j <= m; j++) {
      if (n % 2 && i == n && j % 2 == 1) continue;
      a[i + (j % 2 == 1)][j] = counter;
      counter++;
    }
  }
  for (int i = 1; i <= n; i += 2) {
    for (int j = 1; j <= m; j++) {
      if (n % 2 && i == n && j % 2 == 0) continue;
      a[i + (j % 2 == 0)][j] = counter;
      counter++;
    }
  }
  bool res = true;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if ((i < n && abs(a[i][j] - a[i + 1][j]) <= 1) ||
          (j < m && abs(a[i][j] - a[i][j + 1]) <= 1))
        res = false;
    }
  }
  if (res) {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++) {
        cout << a[i][j] << " ";
      }
      cout << "\n";
    }
  } else {
    cout << -1;
  }
}
