#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
  scanf("%d %d", &n, &m);
  int ans[n + 5][m + 5];
  memset(ans, 0, sizeof(ans));
  if (n == 1 && m == 1) {
    puts("YES\n1");
    return 0;
  }
  if (n == 3 && m == 3) {
    puts("YES");
    puts("6 1 8\n7 5 3\n2 9 4");
    return 0;
  }
  if (n <= 3 && m <= 3) {
    puts("NO");
    return 0;
  }
  puts("YES");
  if (n == 1) {
    for (int i = 2; i <= m; i += 2) printf("%d ", i);
    for (int i = 1; i <= m; i += 2) printf("%d ", i);
    return 0;
  }
  if (m == 1) {
    for (int i = 2; i <= n; i += 2) printf("%d\n", i);
    for (int i = 1; i <= n; i += 2) printf("%d\n", i);
    return 0;
  }
  int cur = 0;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) ans[i][j] = ++cur;
  if (n <= m) {
    for (int i = 1; i <= n; i += 2) {
      for (int j = m; j > 0; --j) ans[i][j + 2] = ans[i][j];
      ans[i][1] = ans[i][m + 1];
      ans[i][2] = ans[i][m + 2];
    }
    for (int j = 1; j <= m; j += 2) {
      for (int i = n; i > 0; --i) ans[i + 1][j] = ans[i][j];
      ans[1][j] = ans[n + 1][j];
    }
  } else {
    for (int j = 1; j <= m; j += 2) {
      for (int i = n; i > 0; --i) ans[i + 2][j] = ans[i][j];
      ans[1][j] = ans[n + 1][j];
      ans[2][j] = ans[n + 2][j];
    }
    for (int i = 1; i <= n; i += 2) {
      for (int j = m; j > 0; --j) ans[i][j + 1] = ans[i][j];
      ans[i][1] = ans[i][m + 1];
    }
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) printf("%d ", ans[i][j]);
    puts("");
  }
  return 0;
}
