#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
bool check(vector<vector<int> > A, vector<vector<int> > B) {
  set<pair<int, int> > g;
  for (int e = 0; e < A.size(); e++) {
    for (int f = 0; f < A[0].size(); f++) {
      for (int t = 0; t < 4; t++) {
        int ne = e + dx[t];
        int nf = f + dy[t];
        if (ne >= 0 && ne < A.size() && nf >= 0 && nf < A[0].size()) {
          g.insert({A[e][f], A[ne][nf]});
        }
      }
    }
  }
  for (int e = 0; e < A.size(); e++) {
    for (int f = 0; f < A[0].size(); f++) {
      for (int t = 0; t < 4; t++) {
        int ne = e + dx[t];
        int nf = f + dy[t];
        if (ne >= 0 && ne < A.size() && nf >= 0 && nf < A[0].size()) {
          if (g.count({B[e][f], B[ne][nf]})) return false;
        }
      }
    }
  }
  return true;
}
void brute(int n, int m) {
  vector<int> con;
  for (int e = 1; e <= n * m; e++) con.push_back(e);
  do {
    vector<vector<int> > table(n, vector<int>(m, 0));
    int cur = 1;
    for (int e = 0; e < n; e++)
      for (int f = 0; f < m; f++) table[e][f] = cur++;
    auto before = table;
    int ptr = 0;
    for (int e = 0; e < n; e++)
      for (int f = 0; f < m; f++) table[e][f] = con[ptr++];
    if (check(before, table)) {
      cout << "YES" << endl;
      for (int e = 0; e < n; e++)
        for (int f = 0; f < m; f++) {
          printf("%d%c", table[e][f], " \n"[f == m - 1]);
        }
      exit(0);
    }
  } while (next_permutation(con.begin(), con.end()));
}
int main() {
  brute(2, 3);
  int n, m;
  cin >> n >> m;
  if (n == 1 && m == 1)
    printf("YES\n1\n");
  else if (n == 1 && m == 2)
    printf("NO\n");
  else if (n == 1 && m == 3)
    printf("NO\n");
  else if (m == 1 && n == 2)
    printf("NO\n");
  else if (m == 1 && n == 3)
    printf("NO\n");
  else if (n == 2 && m == 2)
    printf("NO\n");
  else if (n == 2 && m == 3)
    printf("NO\n");
  else if (m == 2 && n == 3)
    printf("NO\n");
  else if (n == 3 && m == 3) {
    brute(3, 3);
  } else {
    printf("YES\n");
    if (n == 1) {
      vector<int> evens, odds;
      for (int e = 1; e <= m; e++)
        if (e % 2 == 0)
          evens.push_back(e);
        else
          odds.push_back(e);
      reverse(evens.begin(), evens.end());
      reverse(odds.begin(), odds.end());
      for (int v : odds) printf("%d ", v);
      int last = evens.back();
      evens.pop_back();
      for (int v : evens) printf("%d ", v);
      printf("%d\n", last);
    } else if (m == 1) {
      vector<int> evens, odds;
      for (int e = 1; e <= n; e++)
        if (e % 2 == 0)
          evens.push_back(e);
        else
          odds.push_back(e);
      reverse(odds.begin(), odds.end());
      reverse(evens.begin(), evens.end());
      for (int v : odds) printf("%d\n", v);
      for (int v : evens) printf("%d\n", v);
    } else {
      vector<vector<int> > table(n, vector<int>(m, 0));
      int cur = 1;
      for (int e = 0; e < n; e++)
        for (int f = 0; f < m; f++) table[e][f] = cur++;
      auto before = table;
      if (n < m) {
        for (int e = 0; e < m; e++) {
          if (e % 2 == 1) {
            vector<int> cur;
            for (int f = 0; f < n; f++) cur.push_back(table[f][e]);
            cur.push_back(cur[0]);
            cur.erase(cur.begin());
            for (int f = 0; f < n; f++) table[f][e] = cur[f];
          }
        }
        for (int e = 0; e < n; e++) {
          if (e % 2 == 1) {
            vector<int> cur;
            for (int f = 0; f < m; f++) cur.push_back(table[e][f]);
            cur.push_back(cur[0]);
            cur.erase(cur.begin());
            cur.push_back(cur[0]);
            cur.erase(cur.begin());
            for (int f = 0; f < m; f++) table[e][f] = cur[f];
          }
        }
      } else {
        for (int e = 0; e < n; e++) {
          if (e % 2 == 1) {
            vector<int> cur;
            for (int f = 0; f < m; f++) cur.push_back(table[e][f]);
            cur.push_back(cur[0]);
            cur.erase(cur.begin());
            for (int f = 0; f < m; f++) table[e][f] = cur[f];
          }
        }
        for (int e = 0; e < m; e++) {
          if (e % 2 == 1) {
            vector<int> cur;
            for (int f = 0; f < n; f++) cur.push_back(table[f][e]);
            cur.push_back(cur[0]);
            cur.erase(cur.begin());
            cur.push_back(cur[0]);
            cur.erase(cur.begin());
            for (int f = 0; f < n; f++) table[f][e] = cur[f];
          }
        }
      }
      for (int e = 0; e < n; e++)
        for (int f = 0; f < m; f++) {
          printf("%d%c", table[e][f], " \n"[f == m - 1]);
        }
    }
  }
  return 0;
}
