#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int N = 1e5 + 5;
set<pair<int, int> > st;
int t[N];
int tmp[20][20];
int p[400];
bool in_check(int p[], int n, int m) {
  int k = 0;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) tmp[i][j] = p[k++];
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (i - 1 >= 0 &&
          st.find(make_pair(tmp[i - 1][j], tmp[i][j])) != st.end())
        return false;
      if (i + 1 < n && st.find(make_pair(tmp[i + 1][j], tmp[i][j])) != st.end())
        return false;
      if (j - 1 >= 0 &&
          st.find(make_pair(tmp[i][j - 1], tmp[i][j])) != st.end())
        return false;
      if (j + 1 < m && st.find(make_pair(tmp[i][j + 1], tmp[i][j])) != st.end())
        return false;
    }
  }
  return true;
}
bool check(int n, int m) {
  st.clear();
  int all = n * m;
  for (int i = 0; i < all; ++i) p[i] = i + 1;
  int k = 0;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) tmp[i][j] = p[k++];
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (i - 1 >= 0) st.insert(make_pair(tmp[i - 1][j], tmp[i][j]));
      if (i + 1 < n) st.insert(make_pair(tmp[i + 1][j], tmp[i][j]));
      if (j - 1 >= 0) st.insert(make_pair(tmp[i][j - 1], tmp[i][j]));
      if (j + 1 < m) st.insert(make_pair(tmp[i][j + 1], tmp[i][j]));
    }
  }
  bool flag = false;
  do {
    if (in_check(p, n, m)) {
      for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) printf("%d ", tmp[i][j]);
        printf("\n");
      }
      flag = true;
      break;
    }
  } while (next_permutation(p, p + all));
  printf("%s\n\n", flag == true ? "Yes" : "No");
  return flag;
}
void solve(int k, int m, int off) {
  for (int i = 0; i < m; i += 2) t[off * m + (i + off) % m] = k++;
  for (int i = 1; i < m; i += 2) t[off * m + (i + off) % m] = k++;
}
void print(int n, int m, bool f) {
  int k = 0;
  if (!f) {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < m; ++j)
        printf("%d%s", t[k++], j == m - 1 ? "\n" : " ");
    }
  } else {
    swap(n, m);
    int all = n * m;
    for (int i = 0; i < all; ++i) {
      int y = t[i] % n;
      if (y == 0) y = n;
      int x = (t[i] - y) / n + 1;
      t[i] = x + (y - 1) * m;
    }
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < m; ++j)
        printf("%d%s", t[i + j * n], j == m - 1 ? "\n" : " ");
    }
  }
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  bool f = false;
  if (n > m) {
    swap(n, m);
    f = true;
  }
  int all = n * m;
  if (n == 1) {
    if (m == 1)
      printf("YES\n1\n");
    else if (m <= 3)
      printf("NO\n");
    else {
      printf("YES\n");
      if (m == 4)
        t[0] = 2, t[1] = 4, t[2] = 1, t[3] = 3;
      else
        solve(1, m, 0);
      print(n, m, f);
    }
  } else if (n == 2) {
    if (m <= 3)
      printf("NO\n");
    else if (m == 4) {
      printf("YES\n");
      t[0] = 5, t[1] = 4, t[2] = 7, t[3] = 2;
      t[4] = 3, t[5] = 6, t[6] = 1, t[7] = 8;
      print(n, m, f);
    } else {
      printf("YES\n");
      solve(1, m, 0);
      solve(m + 1, m, 1);
      print(n, m, f);
    }
  } else {
    printf("YES\n");
    if (m == 3) {
      printf("1 3 4\n");
      printf("5 7 6\n");
      printf("9 2 8\n");
    } else if (m == 4) {
      if (n == 3) {
        t[0] = 1, t[1] = 3, t[2] = 5, t[3] = 2;
        t[4] = 4, t[5] = 6, t[6] = 12, t[7] = 9;
        t[8] = 11, t[9] = 8, t[10] = 10, t[11] = 7;
        print(n, m, f);
      } else {
        printf("1 9 2 10\n");
        printf("11 3 12 4\n");
        printf("5 13 6 14\n");
        printf("15 7 16 8\n");
      }
    } else {
      for (int i = 0; i < n; ++i) solve(1 + i * m, m, i);
      print(n, m, f);
    }
  }
  return 0;
}
