#include <bits/stdc++.h>
using namespace std;
const int MAXNM = 110;
int a[MAXNM][MAXNM];
int main() {
  int N, M;
  cin >> N >> M;
  bool change = 0;
  if (N < M) swap(N, M), change = 1;
  if (make_pair(N, M) == make_pair(1, 1))
    puts("1");
  else if (N <= 2 || make_pair(N, M) == make_pair(3, 1))
    puts("-1");
  else {
    int k = 1;
    for (int i = 0; i < N; i++)
      for (int j = 0; j < M; j++)
        if ((i + j) % 2 == 1) a[i][j] = k++;
    for (int i = 0; i < N; i++)
      for (int j = 0; j < M; j++)
        if ((i + j) % 2 == 0) a[i][j] = k++;
    assert(k == N * M + 1);
    if (!change)
      for (int i = 0; i < N; i++)
        for (int j = 0; j < M; j++) printf("%d%c", a[i][j], " \n"[j == M - 1]);
    else
      for (int j = 0; j < M; j++)
        for (int i = 0; i < N; i++) printf("%d%c", a[i][j], " \n"[i == N - 1]);
  }
  return 0;
}
