#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000005;
const long long INFLL = 1000000000000000002ll;
const long long MOD = 1000000007;
inline long long min(long long a, long long b, long long c) {
  return min(min(a, b), c);
}
inline long long min(long long a, long long b, long long c, long long d) {
  return min(min(min(a, b), c), d);
}
inline long long max(long long a, long long b, long long c) {
  return max(max(a, b), c);
}
inline long long max(long long a, long long b, long long c, long long d) {
  return max(max(max(a, b), c), d);
}
bool U[155];
int A[12][12], H, W;
bool good(int i, int j) {
  int x = A[i][j];
  int bi = (x - 1) / W + 1;
  int bj = x % W;
  bj = bj == 0 ? W : bj;
  set<int> before;
  for (int ni = (bi - 1); ni <= (bi + 1); ni++)
    for (int nj = (bj - 1); nj <= (bj + 1); nj++)
      if (ni >= 1 && ni <= H && nj >= 1 && nj <= W &&
          abs(bi - ni) + abs(bj - nj) == 1) {
        int num = (ni - 1) * W + nj;
        before.insert(num);
      }
  for (int ni = (i - 1); ni <= (i + 1); ni++)
    for (int nj = (j - 1); nj <= (j + 1); nj++)
      if (ni >= 1 && ni <= H && nj >= 1 && nj <= W &&
          abs(i - ni) + abs(j - nj) == 1) {
        int num = A[ni][nj];
        if (before.find(num) != before.end()) return false;
      }
  return true;
}
bool ok() {
  for (int i = (1); i <= (H); i++)
    for (int j = (1); j <= (W); j++)
      if (!good(i, j)) return false;
  return true;
}
void print() {
  for (int i = (1); i <= (H); i++) {
    for (int j = (1); j <= (W); j++) cout << A[i][j] << " ";
    cout << "\n";
  }
  getchar();
}
vector<int> work(vector<int> v, int add, int inv) {
  if (inv) reverse(v.begin(), v.end());
  vector<int> ret;
  for (int x : v) ret.push_back(x + add);
  return ret;
}
int convert(int x) {
  int st = (x - 1) / W + 1;
  int add = (x - 1) % W;
  return st + add * H;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> H >> W;
  if (H == W && W == 1) {
    cout << "YES\n1";
    return 0;
  }
  bool swapped = false;
  if (H > W) swap(H, W), swapped = true;
  if (W < 3) {
    cout << "NO";
    return 0;
  }
  if (W == 3) {
    if (H < 3) {
      cout << "NO";
      return 0;
    }
    cout << "YES\n1 3 4\n5 7 6\n9 2 8";
    return 0;
  }
  vector<int> vec, vec2;
  if (W == 4)
    vec = {2, 4, 1, 3};
  else {
    for (int i = 1; i <= W; i += 2) vec.push_back(i);
    for (int i = 2; i <= W; i += 2) vec.push_back(i);
    for (int i = 3; i <= W; i += 2) vec2.push_back(i);
    for (int i = 2; i <= W; i += 2) vec2.push_back(i);
    vec2.push_back(1);
    reverse(vec2.begin(), vec2.end());
  }
  vector<vector<int>> mat(H, vector<int>(W, 0));
  cout << "YES\n";
  for (int row = 0; row < H; row++) {
    if (W & 1) {
      if (row & 1)
        mat[row] = work(vec, row * W, row & 1);
      else
        mat[row] = work(vec2, row * W, row & 1);
    } else
      mat[row] = work(vec, row * W, row & 1);
  }
  if (!swapped) {
    for (int i = (0); i <= (H - 1); i++) {
      for (int j = (0); j <= (W - 1); j++) cout << mat[i][j] << " ";
      cout << "\n";
    }
  } else {
    for (int j = (0); j <= (W - 1); j++) {
      for (int i = (0); i <= (H - 1); i++) cout << convert(mat[i][j]) << " ";
      cout << "\n";
    }
  }
}
