#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100100;
vector<vector<int> > v, bio;
vector<int> v1[MAXN];
int n, m;
vector<int> perm;
const int smjerx[] = {-1, 0, 1, 0};
const int smjery[] = {0, -1, 0, 1};
int block[MAXN], cookie;
int main() {
  srand(time(NULL));
  scanf("%d %d", &n, &m);
  double start = clock();
  vector<int> t;
  for (int i = (0); i < int(m); i++) t.push_back(0);
  for (int i = (0); i < int(n); i++) v.push_back(t);
  bio = v;
  t.clear();
  for (int i = (0); i < int(n * m); i++) t.push_back(i + 1);
  for (int i = (0); i < int(15); i++) random_shuffle((t).begin(), (t).end());
  for (int i = (0); i < int(n); i++)
    for (int j = (0); j < int(m); j++) v[i][j] = t[i * m + j];
  while ((clock() - start) / CLOCKS_PER_SEC <= 1.7) {
    cookie++;
    bool ok = 1;
    for (int i = (0); i < int(n); i++) {
      for (int j = (0); j < int(m); j++) {
        for (int k = (0); k < int(4); k++) {
          int nx = i + smjerx[k];
          int ny = j + smjery[k];
          if (nx < 0 || nx >= n || ny < 0 || ny >= m) continue;
          int x = v[nx][ny];
          int y = v[i][j];
          if (x == y + m || x == y - m || x == y - 1 || x == y + 1) {
            ok = 0;
            bio[i][j] = cookie;
          }
        }
      }
    }
    for (int i = (0); i < int(n); i++) {
      for (int j = (0); j < int(m); j++) {
        if (bio[i][j] == cookie) {
          int x = rand() % n;
          int y = rand() % m;
          swap(v[i][j], v[x][y]);
        }
      }
    }
    if (ok) {
      puts("YES");
      for (int i = (0); i < int(n); i++) {
        for (int j = (0); j < int(m); j++) printf("%d ", v[i][j]);
        puts("");
      }
      return 0;
    }
  }
  puts("NO");
  return 0;
}
