#include <bits/stdc++.h>
using namespace std;
int n, m, a[100011], dx[] = {-1, 1, 0, 0}, ddy[] = {0, 0, -1, 1};
int check(int x) {
  for (int i = 0; i < 4; i++)
    if ((x > 1 && x % m != 1 && a[x - 1] == a[x] + dx[i] + ddy[i] * m) ||
        (x > m && a[x - m] == a[x] + dx[i] + ddy[i] * m))
      return 0;
  return 1;
}
int dfs(int x) {
  if (x > n * m) return 1;
  for (int i = x; i <= n * m; i++) {
    swap(a[x], a[i]);
    if (!check(x)) continue;
    if (dfs(x + 1)) return 1;
    swap(a[x], a[i]);
  }
  return 0;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) a[(i - 1) * m + j] = (i - 1) * m + j;
  if (dfs(1)) {
    puts("YES");
    for (int i = 1; i <= n; i++, puts(""))
      for (int j = 1; j <= m; j++) printf("%d ", a[(i - 1) * m + j]);
  } else
    puts("NO");
}
