#include <bits/stdc++.h>
using namespace std;
long long n, m, a[111111], sz, last, nlen, b[111111];
vector<vector<long long> > v, sol;
map<pair<long long, long long>, long long> vv;
void solve(long long len, long long ch) {
  sz = 0;
  if (ch) {
    if (len % 2 == 0) {
      for (long long i = 2; i <= len; i += 2) a[++sz] = b[i];
      for (long long i = 1; i <= len; i += 2) a[++sz] = b[i];
    } else {
      for (long long i = 1; i <= len; i += 2) a[++sz] = b[i];
      for (long long i = 2; i <= len; i += 2) a[++sz] = b[i];
    }
  } else {
    if (len % 2 == 0) {
      for (long long i = 2; i <= len; i += 2) a[++sz] = b[i];
      for (long long i = 1; i <= len; i += 2) a[++sz] = b[i];
      reverse(a + 1, a + sz + 1);
    } else {
      for (long long i = 2; i <= len; i += 2) a[++sz] = b[i];
      for (long long i = 1; i <= len; i += 2) a[++sz] = b[i];
    }
  }
  for (long long i = 1; i <= len; i++) b[i] = a[i];
}
int main() {
  cin >> n >> m;
  if (n * m == 1) {
    cout << "YES\n1\n";
    return 0;
  }
  if (n == 3 && m == 3) {
    cout << "YES\n1 5 9\n6 7 3\n4 2 8";
    return 0;
  }
  if (n <= 3 && m <= 3) {
    cout << "NO";
    return 0;
  }
  cout << "YES\n";
  sol.resize(n + 1);
  for (long long i = 1; i <= n; i++) sol[i].resize(m + 1);
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= m; j++) sol[i][j] = (i - 1) * m + j;
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= m; j++) {
      if (i > 1)
        vv[{sol[i][j], sol[i - 1][j]}] = vv[{sol[i - 1][j], sol[i][j]}] = 1;
      if (j > 1)
        vv[{sol[i][j], sol[i][j - 1]}] = vv[{sol[i][j - 1], sol[i][j]}] = 1;
    }
  if (n <= m) {
    v.resize(n + 1);
    for (long long i = 0; i <= n; i++) v[i].resize(m + 1);
    for (long long i = 1; i <= n; i++) {
      for (long long j = 1; j <= m; j++) b[j] = (i - 1) * m + j;
      solve(m, i & 1);
      for (long long j = 1; j <= m; j++) v[i][j] = b[j];
    }
    for (long long i = 1; i <= n; i++) {
      for (long long j = 1; j <= m; j++) printf("%lld ", v[i][j]);
      printf("\n");
    }
  } else {
    v.resize(n + 1);
    for (long long i = 0; i <= n; i++) v[i].resize(m + 1);
    for (long long j = 1; j <= m; j++) {
      for (long long i = 1; i <= n; i++) b[i] = (i - 1) * m + j;
      solve(n, j & 1);
      for (long long i = 1; i <= n; i++) v[i][j] = b[i];
    }
    for (long long i = 1; i <= n; i++) {
      for (long long j = 1; j <= m; j++) printf("%lld ", v[i][j]);
      printf("\n");
    }
  }
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= m; j++) {
      if (i > 1 && vv.count({v[i][j], v[i - 1][j]})) assert(0);
      if (j > 1 && vv.count({v[i][j], v[i][j - 1]})) assert(0);
    }
}
