#include <bits/stdc++.h>
using namespace std;
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "RDLU";
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int &x, int y, int mod = 1000000007) {
  assert(y >= 0);
  x += y;
  if (x >= mod) x -= mod;
  assert(x >= 0 && x < mod);
}
void et() {
  puts("-1");
  exit(0);
}
long long fastPow(long long x, long long y, int mod = 1000000007) {
  long long ans = 1;
  while (y > 0) {
    if (y & 1) ans = (x * ans) % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
long long gcd1(long long x, long long y) {
  long long z = y;
  while (x % y != 0) {
    z = x % y;
    x = y;
    y = z;
  }
  return z;
}
vector<int> vp[100005];
bool sp = 0;
void cal() {
  if (m == 1) {
    puts("YES\n1");
    exit(0);
  } else if (n == 3 && m == 3) {
    puts("YES\n6 1 8\n7 5 3\n2 9 4");
    exit(0);
  }
  if (m <= 3) etp();
  int num = 1;
  for (int(i) = 1; (i) <= (int)(n); (i)++) {
    vp[i].resize(m + 1);
    if (m == 4) {
      if (i & 1) {
        vp[i][2] = num++;
        vp[i][4] = num++;
        vp[i][1] = num++;
        vp[i][3] = num++;
      } else {
        vp[i][3] = num++;
        vp[i][1] = num++;
        vp[i][4] = num++;
        vp[i][2] = num++;
      }
      continue;
    }
    int pos = i & 1, st = pos;
    for (int(j) = 1; (j) <= (int)(m); (j)++) {
      vp[i][pos + 1] = num++;
      pos = (pos + 2);
      if (m <= pos) pos = st ^ 1;
    }
  }
}
void fmain(int ID) {
  scanf("%d%d", &n, &m);
  if (m < n) {
    swap(n, m);
    sp = 1;
  }
  cal();
  puts("YES");
  if (!sp) {
    for (int(i) = 1; (i) <= (int)(n); (i)++) {
      for (int(j) = 1; (j) <= (int)(m); (j)++) printf("%d ", vp[i][j]);
      puts("");
    }
  } else {
    map<int, int> rev;
    for (int(j) = 1; (j) <= (int)(m); (j)++)
      for (int(i) = 1; (i) <= (int)(n); (i)++) {
        rev[(i - 1) * m + j] = (j - 1) * n + i;
      }
    for (int(j) = 1; (j) <= (int)(m); (j)++) {
      for (int(i) = 1; (i) <= (int)(n); (i)++) printf("%d ", rev[vp[i][j]]);
      puts("");
    }
  }
}
int main() {
  int t = 1;
  for (int(i) = 1; (i) <= (int)(t); (i)++) {
    fmain(i);
  }
  return 0;
}
