#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
int ni() {
  int val;
  scanf("%i", &val);
  return val;
}
pair<int, int> npi() {
  pair<int, int> val;
  scanf("%i %i", &val.first, &val.second);
  return val;
}
int64_t nll() {
  int64_t val;
  scanf("%I64d", &val);
  return val;
}
vector<int> nvi(int n, int corr = 0) {
  vector<int> a(n);
  for (int i = 0; i < n; ++i) a[i] = ni() + corr;
  return move(a);
}
char nc() {
  char val;
  do {
    val = getchar();
  } while (val == ' ' || val == '\r' || val == '\n');
  return val;
}
char ncs() {
  char val;
  do {
    val = getchar();
  } while (false);
  return val;
}
string ns() {
  static char buff[1024 * 4000];
  scanf("%s", buff);
  return string{buff};
}
int64_t gcd(int64_t a, int64_t b) {
  while (b) {
    auto tmp = a % b;
    a = b;
    b = tmp;
  }
  return a;
}
int64_t tr2(int xv1, int yv1, int xv2, int yv2, int x3, int y3) {
  return 1LL * (xv2 - xv1) * (y3 - yv1) - 1LL * (yv2 - yv1) * (x3 - xv1);
}
const long double eps = 1e-12;
const long double pi = acos(-1.0);
bool eq(long double a, long double b) { return abs(a - b) <= eps; }
int8_t bits_cnt[256];
const string input_dir = "inputs\\";
string input_file = input_dir + "input.txt";
string output_file = input_dir + "output.txt";
void init_streams() {}
void init_data() {
  for (int i = 1; i <= 255; ++i)
    for (int j = 0; j < 8; ++j)
      if ((1 << j) & i) ++bits_cnt[i];
}
int bit_count(int v) {
  return bits_cnt[v & 0xFF] + bits_cnt[(v >> 8) & 0xFF] +
         bits_cnt[(v >> 16) & 0xFF] + bits_cnt[(v >> 24) & 0xFF];
}
void ret_no() {
  cout << "NO\n";
  exit(0);
}
void check_no(int n, int m) {
  if ((n == 1 && m == 2) || (n == 1 && m == 3) || (n == 2 && m == 1) ||
      (n == 3 && m == 1) || (n == 2 && m == 2) || (n == 3 && m == 2) ||
      (n == 2 && m == 3))
    ret_no();
  if (n == 1 && m == 1) {
    cout << "YES\n";
    cout << "1\n";
    exit(0);
  }
  if (n == 3 && m == 3) {
    cout << "YES\n6 1 8\n7 5 3\n2 9 4\n";
    exit(0);
  }
}
void shuffle(vector<int>& a, int offset) {
  for (int i = offset; i + 1 < a.size(); i += 2) swap(a[i], a[i + 1]);
}
int main() {
  init_streams();
  init_data();
  auto n = ni(), m = ni();
  check_no(n, m);
  if (n == 1) {
    vector<int> v(m);
    for (int i = 0; i < m; ++i) v[i] = i + 1;
    shuffle(v, 0);
    shuffle(v, 1);
    cout << "YES\n";
    for (auto q : v) cout << q << " ";
  } else if (m == 1) {
    vector<int> v(n);
    for (int i = 0; i < n; ++i) v[i] = i + 1;
    shuffle(v, 0);
    shuffle(v, 1);
    cout << "YES\n";
    for (auto q : v) cout << q << "\n";
  } else {
    vector<vector<int>> vs(n, vector<int>(m));
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= m; ++j) {
        vs[i - 1][j - 1] = (i - 1) * m + j;
      }
    int r = (m <= 3) ? 1 : 2;
    for (int i = 0; i < n; i += 2) {
      for (int j = 0; j < r; ++j) {
        vs[i].push_back(vs[i].front());
        vs[i].erase(vs[i].begin());
      }
    }
    int q = (m <= 3) ? 2 : 1;
    while (q--) {
      for (int i = 0; i < m; i += 2) {
        auto top = vs[0][i];
        for (int j = 1; j < n; ++j) vs[j - 1][i] = vs[j][i];
        vs[n - 1][i] = top;
      }
    }
    cout << "YES\n";
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < m; ++j) cout << vs[i][j] << " ";
      cout << "\n";
    }
  }
  return 0;
}
