#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 1, MAGIC = 10;
int arr[MAX];
int main() {
  srand(time(0));
  ios::sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n * m; ++i) arr[i] = i + 1;
  while (0.0 + clock() / CLOCKS_PER_SEC < 1.95) {
    random_shuffle(arr, arr + n * m);
    for (int t = 0; t < MAGIC; ++t) {
      int wrong = -1;
      for (int i = 0; i < n * m; ++i) {
        if (i / m != 0) {
          if (abs(arr[i] - arr[i - m]) == 1 || abs(arr[i] - arr[i - m]) == m)
            wrong = i;
        }
        if (i % m != 0) {
          if (abs(arr[i] - arr[i - 1]) == 1 || abs(arr[i] - arr[i - 1]) == m)
            wrong = i;
        }
      }
      if (wrong == -1) {
        cout << "YES\n";
        for (int i = 0; i < n * m; ++i) {
          cout << arr[i] << ' ';
          if (i % m == m - 1) cout << endl;
        }
        return 0;
      }
      swap(arr[wrong], arr[rand() % (n * m)]);
    }
  }
  cout << "NO\n";
  return 0;
}
