#include <bits/stdc++.h>
using namespace std;
int m, n, arr[100][100];
bool f = false;
int main() {
  cin >> n >> m;
  if (n > m) {
    swap(n, m);
    f = true;
  }
  if (m + n < 5) {
    if (m * n == 1) {
      cout << "1";
      return 0;
    } else {
      cout << "-1";
      return 0;
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      arr[i][j] = 1 + j + i * m;
    }
  }
  if (n == 1) {
    for (int i = 0; i < m - 1; i += 2) swap(arr[0][i], arr[0][i + 1]);
    for (int i = 1; i < m - 1; i += 2) swap(arr[0][i], arr[0][i + 1]);
  } else {
    for (int i = 0; i < n - 1; ++i) {
      for (int j = i % 2; j < m; j += 2) {
        swap(arr[i][j], arr[i + 1][j]);
      }
    }
  }
  if (f) {
    for (int i = 0; i < m; i++) {
      for (int j = 0; j < n; j++) cout << arr[j][i] << " ";
      cout << endl;
    }
  } else {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) cout << arr[i][j] << " ";
      cout << endl;
    }
  }
}
