#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  srand(time(0));
  int n, m, flag = 1;
  cin >> n >> m;
  if (n == m && n == 1) {
    cout << "YES\n1";
    return 0;
  }
  if (max(n, m) < 3 || (max(n, m) == 3 && min(n, m) < 3)) {
    cout << "NO";
    return 0;
  }
  cout << "YES\n";
  vector<int> a;
  for (int i = 1; i <= n * m; ++i) a.push_back(i);
  while (flag) {
    flag = 0;
    random_shuffle(a.begin(), a.end());
    for (int i = 0; i < n * m; ++i) {
      if (i >= m && (abs(a[i] - a[i - m]) == m || abs(a[i] - a[i - m]) == 1)) {
        flag = 1;
        break;
      }
      if (i + m < n * m &&
          (abs(a[i] - a[i + m]) == m || abs(a[i] - a[i + m]) == 1)) {
        flag = 1;
        break;
      }
      if (i % m && (abs(a[i] - a[i - 1]) == m || abs(a[i] - a[i - 1]) == 1)) {
        flag = 1;
        break;
      }
      if ((i + 1) % m &&
          (abs(a[i] - a[i + 1]) == m || abs(a[i] - a[i + 1]) == 1)) {
        flag = 1;
        break;
      }
    }
  }
  for (int i = 0; i < n * m; ++i) {
    cout << a[i] << " ";
    if ((i + 1) % m == 0) cout << '\n';
  }
  return 0;
}
