#include <bits/stdc++.h>
using namespace std;
const int NMAX = 1e5 + 10;
int n, m, val, caseno;
int pos[1 + NMAX];
map<int, map<int, int> > mp;
bool ok() {
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (i < n && ((abs(mp[i][j] % m - mp[i + 1][j] % m) +
                     abs(mp[i][j] / m - mp[i + 1][j] / m)) < 2) == true)
        return false;
      if (j < m && ((abs(mp[i][j] % m - mp[i][j + 1] % m) +
                     abs(mp[i][j] / m - mp[i][j + 1] / m)) < 2) == true)
        return false;
    }
  }
  return true;
}
void write() {
  cout << "YES\n";
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (caseno == 1)
        cout << mp[j][i] % n * m + mp[j][i] / n + 1 << ' ';
      else
        cout << mp[i][j] + 1 << ' ';
    }
    cout << '\n';
  }
}
int main() {
  cin >> n >> m;
  srand(time(0));
  if ((n <= 5 && m <= 5)) {
    caseno = 0;
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= m; j++) mp[i][j] = val++;
    int i = 10000;
    while (i != 0) {
      swap(mp[rand() % n + 1][rand() % m + 1],
           mp[rand() % n + 1][rand() % m + 1]);
      if (ok() == true) {
        write();
        exit(EXIT_SUCCESS);
      }
      i--;
    }
    cout << "NO\n";
    exit(EXIT_SUCCESS);
  } else {
    caseno = 0;
    if (m < n) {
      caseno = 1;
      swap(n, m);
    }
    for (int j = 1; j <= m; j++) pos[j] = j & 1 ? j / 2 : j / 2 + (m - 1) / 2;
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= m; j++) mp[i][(pos[j] + i % 2) % m + 1] = val++;
    if (caseno == 1) swap(n, m);
    write();
  }
  return 0;
}
