#include <bits/stdc++.h>
using namespace std;
int n, m;
void m1() {
  int c = 0;
  for (int v = 2; v <= n * m; v += 2) {
    printf("%d", v);
    c++;
    if (c % m == 0)
      puts("");
    else
      printf(" ");
  }
  for (int v = 1; v <= n * m; v += 2) {
    printf("%d", v);
    c++;
    if (c % m == 0)
      puts("");
    else
      printf(" ");
  }
}
void m2() {
  if (n == 2) {
    for (int i = 1; i <= m; i++) {
      if (i & 1)
        printf("%d ", i);
      else
        printf("%d ", i + m);
    }
    puts("");
    for (int i = 3; i <= m; i++)
      if (i & 1)
        printf("%d ", i + m);
      else
        printf("%d ", i);
    printf("%d 2", m + 1);
  } else {
    vector<vector<int>> out(n, vector<int>(m));
    for (int i = 0; i < n; i++) {
      if (i & 1)
        out[i][1] = 2 * i + 1;
      else
        out[i][1] = 2 * i + 2;
    }
    for (int i = 2; i < n; i++)
      if (i & 1)
        out[i - 2][0] = 2 * i + 2;
      else
        out[i - 2][0] = 2 * i + 1;
    out[n - 2][0] = 1;
    out[n - 1][0] = 4;
    for (int i = 0; i < n; ++i)
      for (int j = 0; j < m; ++j) printf("%d%c", out[i][j], " \n"[j + 1 == m]);
  }
}
void m3() {
  vector<vector<int>> vec(n, vector<int>(m));
  if (m == 3) {
    int i = 0;
    for (int ri = 1; ri < n; i++, ri += 2)
      for (int j = 0; j < m; ++j) vec[i][j] = ri * m + j + 1;
    for (int ri = 0; ri < n; i++, ri += 2)
      for (int j = 0; j < m; ++j) vec[i][j] = ri * m + j + 1;
    int v = vec[n - 1][1];
    for (int i = n - 1; i; i--) vec[i][1] = vec[i - 1][1];
    vec[0][1] = v;
  } else {
    int j = 0;
    for (int rj = 1; rj < m; j++, rj += 2)
      for (int i = 0; i < n; ++i) vec[i][j] = i * m + rj + 1;
    for (int rj = 0; rj < m; j++, rj += 2)
      for (int i = 0; i < n; ++i) vec[i][j] = i * m + rj + 1;
    int v = vec[1][m - 1];
    for (int j = m - 1; j; j--) vec[1][j] = vec[1][j - 1];
    vec[1][0] = v;
  }
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) printf("%d%c", vec[i][j], " \n"[j + 1 == m]);
}
void m4() {
  vector<vector<int>> vec(n, vector<int>(m));
  int j = 0;
  for (int rj = 1; rj < m; j++, rj += 2)
    for (int i = 0; i < n; ++i) vec[i][j] = i * m + rj + 1;
  for (int rj = 0; rj < m; j++, rj += 2)
    for (int i = 0; i < n; ++i) vec[i][j] = i * m + rj + 1;
  vector<vector<int>> out(n, vector<int>(m));
  for (int i = 1; i < n; i += 2)
    for (int j = 0; j < m; ++j) printf("%d%c", vec[i][j], " \n"[j + 1 == m]);
  for (int i = 0; i < n; i += 2)
    for (int j = 0; j < m; ++j) printf("%d%c", vec[i][j], " \n"[j + 1 == m]);
}
int main() {
  scanf("%d", &n), scanf("%d", &m);
  if (max(n, m) <= 3) {
    if (n == 3 && m == 3) return puts("YES\n1 3 4\n5 7 6\n9 2 8");
    if (n == 1 && m == 1) return puts("YES\n1");
    return puts("NO");
  }
  puts("YES");
  if (min(n, m) == 1)
    m1();
  else if (min(n, m) == 2)
    m2();
  else if (min(n, m) == 3) {
    if (n == 3 && m == 4) return puts("1 3 5 2\n4 6 12 9\n11 8 10 7");
    if (n == 4 && m == 3) return puts("1 3 4\n5 7 2\n11 6 8\n9 10 12");
    m3();
  } else
    m4();
}
