#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream& operator<<(ostream& stream, const vector<T> v) {
  stream << "[ ";
  for (int i = 0; i < (int)v.size(); i++) stream << v[i] << " ";
  stream << "]";
  return stream;
}
long long fpow(long long x, long long p, long long m) {
  long long r = 1;
  for (; p; p >>= 1) {
    if (p & 1) r = r * x % m;
    x = x * x % m;
  }
  return r;
}
int gcd(int a, int b) {
  if (!b) return a;
  return gcd(b, a % b);
}
long long gcd(long long a, long long b) {
  if (!b) return a;
  return gcd(b, a % b);
}
int N, M;
vector<vector<int> > a, b;
int dx[4] = {1, -1, 0, 0}, dy[4] = {0, 0, 1, -1};
bool adj(int a, int b) {
  return (abs(a / M - b / M) + abs(a % M - b % M)) == 1;
}
bool valid(int x, int y) { return (x >= 0 && x < N && y >= 0 && y < M); }
void brut() {
  int i, j;
  vector<int> arr;
  for (i = 0; i < N * M; i++) arr.push_back(i);
  do {
    for (i = 0; i < N * M; i++) a[i / M][i % M] = arr[i];
    bool ok = 1;
    for (i = 0; i < N; i++)
      for (j = 0; j < M; j++) {
        for (int k = 0; k < 4; k++) {
          int nx = i + dx[k], ny = j + dy[k];
          if (valid(nx, ny) && adj(a[i][j], a[nx][ny])) ok = 0;
        }
      }
    if (ok) {
      cout << "YES\n";
      for (i = 0; i < N; i++, cout << "\n")
        for (j = 0; j < M; j++) cout << a[i][j] + 1 << " ";
      return;
    }
  } while (next_permutation((arr).begin(), (arr).end()));
  cout << "NO\n";
  return;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> N >> M;
  int i, j;
  if (N <= 3 && M <= 3) {
    a.resize(N);
    for (i = 0; i < N; i++) a[i].resize(M);
    brut();
    return 0;
  }
  bool swp = 0;
  if (M < 4) swap(N, M), swp = 1;
  a.resize(N);
  b.resize(N);
  for (i = 0; i < N; i++) a[i].resize(M), b[i].resize(M);
  for (i = 0; i < N; i++)
    for (j = 0; j < M; j++) a[i][j] = i * M + j;
  if (M == 4) {
    for (i = 0; i < N; i++) {
      if (i % 2 == 0) {
        b[i][0] = a[i][1], b[i][1] = a[i][3];
        b[i][2] = a[i][0], b[i][3] = a[i][2];
      } else {
        b[i][0] = a[i][2], b[i][1] = a[i][0];
        b[i][2] = a[i][3], b[i][3] = a[i][1];
      }
    }
  } else {
    for (i = 0; i < N; i++) {
      int p = 0, k;
      if (i % 2 == 0) {
        for (k = 0; k < M; k += 2) b[i][p++] = a[i][k];
        for (k = 1; k < M; k += 2) b[i][p++] = a[i][k];
      } else {
        for (k = 1; k < M; k += 2) b[i][p++] = a[i][k];
        for (k = 0; k < M; k += 2) b[i][p++] = a[i][k];
      }
    }
  }
  if (swp) {
    a.clear();
    a.resize(M);
    for (i = 0; i < M; i++) a[i].resize(N);
    for (i = 0; i < N; i++)
      for (j = 0; j < M; j++) {
        int l = b[i][j] / M, c = b[i][j] % M;
        a[j][i] = c * N + l + 1;
      }
    swap(N, M);
  } else {
    for (i = 0; i < N; i++)
      for (j = 0; j < M; j++) a[i][j] = b[i][j] + 1;
  }
  cout << "YES\n";
  for (i = 0; i < N; i++, cout << "\n")
    for (j = 0; j < M; j++) cout << a[i][j] << " ";
  return 0;
}
