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