#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int px[maxn], py[maxn], p[maxn], v[maxn];
bool adjc(int u, int v) {
  if (u > v) swap(u, v);
  if (px[v] == px[u] && py[v] == py[u] + 1) return 1;
  if (py[u] == py[v] && px[v] == px[u] + 1) return 1;
  return 0;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n * m; i++) {
    px[i] = i / m, py[i] = i % m;
    v[i] = i;
  }
  while (clock() <= 1.9 * CLOCKS_PER_SEC) {
    random_shuffle(v, v + n * m);
    set<pair<int, int> > hs;
    for (int i = 0; i < n * m; i++) hs.insert(make_pair(v[i], i));
    bool val = 1;
    for (int i = 0; i < n * m; i++) {
      int suc = 0;
      set<pair<int, int> >::iterator it = hs.begin();
      while (1) {
        suc = 1;
        p[i] = it->second;
        int x = i / m, y = i % m;
        if (x && adjc(p[i], p[i - m])) suc = 0;
        if (y && adjc(p[i], p[i - 1])) suc = 0;
        if (suc) {
          hs.erase(it);
          break;
        }
        it++;
        if (it == hs.end()) break;
      }
      if (!suc) {
        val = 0;
        break;
      }
    }
    if (val) {
      printf("YES\n");
      for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) printf("%d ", p[i * m + j] + 1);
        printf("\n");
      }
      return 0;
    }
  }
  printf("NO\n");
  return 0;
}
