#include <bits/stdc++.h>
using namespace std;
int b[100011];
vector<int> a[100011];
int main() {
  int n, m;
  cin >> n >> m;
  if (n == 1 and m == 1) return puts("YES\n1");
  if (n == 3 and m == 3) {
    puts("YES"), puts("4 9 2"), puts("3 5 7");
    return puts("8 1 6");
  }
  if (n < 4 and m < 4) return puts("NO");
  puts("YES");
  int st = 0, nn = 0;
  if (m > 4) {
    for (int i = 0; i < n; i++, st ^= 1) {
      for (int j = st; j < m; j += 2) b[j] = ++nn;
      for (int j = st ^ 1; j < m; j += 2) b[j] = ++nn;
      for (int j = 0; j < m; j++) printf("%d ", b[j]);
      puts("");
    }
    return 0;
  }
  if (n > 4) {
    for (int i = 1; i <= m; i++, st ^= 1) {
      nn = i;
      for (int j = st; j < n; j += 2, nn += m) a[j].push_back(nn);
      for (int j = st ^ 1; j < n; j += 2, nn += m) a[j].push_back(nn);
    }
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) printf("%d ", a[i][j]);
      puts("");
    }
    return 0;
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) a[i].push_back(++nn);
  if (n == 4) {
    for (int j = 0; j < m; j++) {
      swap(a[0][j], a[1][j]), swap(a[2][j], a[3][j]);
      if (j & 1)
        swap(a[1][j], a[2][j]);
      else
        swap(a[0][j], a[3][j]);
    }
  } else {
    for (int j = 0; j < n; j++) {
      swap(a[j][0], a[j][1]);
      swap(a[j][2], a[j][3]);
      if (j & 1)
        swap(a[j][0], a[j][3]);
      else
        swap(a[j][1], a[j][2]);
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) printf("%d ", a[i][j]);
    puts("");
  }
  return 0;
}
