#include <bits/stdc++.h>
using namespace std;
int n, m;
const int maxn = 1e5 + 10;
const int inf = 1e9;
bool flag[maxn];
vector<int> ve[maxn];
set<int> s;
inline void dfs(int x, int y) {
  if (x == n && y == m + 1) {
    puts("YES");
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++) printf("%d ", ve[i][j]);
      printf("\n");
    }
    exit(0);
  }
  if (y == m + 1) x++, y = 1;
  for (auto i = s.begin(); i != s.end(); i++) {
    int num = *i;
    if (ve[x][y - 1] - 1 == num) continue;
    if (ve[x][y - 1] + 1 == num) continue;
    if (ve[x][y - 1] - m == num) continue;
    if (ve[x][y - 1] + m == num) continue;
    if (ve[x - 1][y] - 1 == num) continue;
    if (ve[x - 1][y] + 1 == num) continue;
    if (ve[x - 1][y] - m == num) continue;
    if (ve[x - 1][y] + m == num) continue;
    s.erase(num);
    ve[x][y] = num;
    dfs(x, y + 1);
    s.insert(num);
    i = s.find(num);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i <= n + 1; i++)
    for (int j = 0; j <= m + 1; j++) ve[i].push_back(-inf);
  for (int i = 1; i <= n * m; i++) s.insert(i);
  dfs(1, 1);
  puts("NO");
  return 0;
}
