#include <bits/stdc++.h>
using namespace std;
int** classRoom;
int n, m;
bool nextTo(int p1, int p2) {
  if (p2 == p1 + 1) {
    return true;
  }
  if (p2 == p1 - 1) {
    return true;
  }
  if (p2 == p1 + m) {
    return true;
  }
  if (p2 == p1 - m) {
    return true;
  }
  return false;
}
bool dfs(int step = 0) {
  if (step == n * m) {
    return true;
  }
  int xPos = step / m;
  int yPos = step % m;
  for (int i = step; i < n * m; i++) {
    int xNext = i / m, yNext = i % m;
    swap(classRoom[xPos][yPos], classRoom[xNext][yNext]);
    if ((xPos != 0 &&
         nextTo(classRoom[xPos][yPos], classRoom[xPos - 1][yPos])) ||
        (yPos != 0 &&
         nextTo(classRoom[xPos][yPos], classRoom[xPos][yPos - 1]))) {
      continue;
    }
    if (dfs(step + 1)) {
      return true;
    }
    swap(classRoom[xPos][yPos], classRoom[xNext][yNext]);
  }
  return false;
}
int main(void) {
  cin >> n >> m;
  classRoom = new int*[n];
  for (int i = 0; i < n; i++) {
    classRoom[i] = new int[m];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      classRoom[i][j] = i * m + j;
    }
  }
  if (dfs()) {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        cout << classRoom[i][j] + 1 << ' ';
      }
      cout << endl;
    }
  } else {
    cout << "NO" << endl;
  }
  for (int i = 0; i < n; i++) {
    delete[] classRoom[i];
  }
  delete[] classRoom;
}
