#include <bits/stdc++.h>
using namespace std;
const int N = 1E5 + 7;
vector<int> xin[N];
vector<int> a[N], b[N];
bool vis[N];
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int n, m;
bool check(int x, int sb1, int sb2) {
  if (sb1 <= 0 || sb2 <= 0) return false;
  for (int i = 0; i < xin[x].size(); i++) {
    if (xin[x][i] == b[sb1][sb2]) return true;
  }
  return false;
}
int get_rand() { return rand() * rand() % (n * m) + 1; }
void solve() {
  int num;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      int x = get_rand();
      num = 0;
      while ((num <= (n * m) * 2) &&
             (vis[x] == false || check(x, i, j - 1) || check(x, i - 1, j))) {
        x = get_rand();
        num++;
      }
      if (num > (n * m) * 2) return;
      vis[x] = false;
      b[i][j] = x;
    }
  }
  printf("YES\n");
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) printf("%d ", b[i][j]);
    printf("\n");
  }
  exit(0);
}
int main() {
  scanf("%d%d", &n, &m);
  srand((unsigned)time(0));
  for (int i = 1; i <= n; i++) {
    a[i].resize(m + 5);
    b[i].resize(m + 5);
    for (int j = 1; j <= m; j++) {
      a[i][j] = (i - 1) * m + j;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      for (int k = 0; k < 4; k++) {
        int x = i + dx[k], y = j + dy[k];
        if (x <= n && x >= 1 && y <= m && y >= 1)
          xin[a[i][j]].push_back(a[x][y]);
      }
    }
  }
  for (int i = 1; i <= 100; i++) {
    memset(vis, true, sizeof(vis));
    solve();
  }
  printf("NO\n");
  return 0;
}
