#include <bits/stdc++.h>
using namespace std;
int N, M;
vector<int> G[100013];
int a[9] = {1, 3, 5, 6, 2, 7, 4, 8, 9};
int* g[3] = {a, a + 3, a + 6};
bool judge(int N, int M) {
  for (int i = int(0), __border_righti = int(N); i < __border_righti; i++) {
    for (int j = int(0), __border_rightj = int(M - 1); j < __border_rightj;
         j++) {
      int x1 = (g[i][j] - 1) / M, x2 = (g[i][j + 1] - 1) / M,
          y1 = (g[i][j] - 1) % M, y2 = (g[i][j + 1] - 1) % M;
      if (x1 == x2 && abs(y1 - y2) == 1) {
        return false;
      }
      if (y1 == y2 && abs(x1 - x2) == 1) {
        return false;
      }
    }
  }
  for (int i = int(0), __border_righti = int(N - 1); i < __border_righti; i++) {
    for (int j = int(0), __border_rightj = int(M); j < __border_rightj; j++) {
      int x1 = (g[i][j] - 1) / M, x2 = (g[i + 1][j] - 1) / M,
          y1 = (g[i][j] - 1) % M, y2 = (g[i + 1][j] - 1) % M;
      if (x1 == x2 && abs(y1 - y2) == 1) {
        return false;
      }
      if (y1 == y2 && abs(x1 - x2) == 1) {
        return false;
      }
    }
  }
  cout << "A";
  return true;
}
void dfs(int k, int N, int M) {
  if (k == N * M - 1) {
    if (judge(N, M)) {
      for (int i = int(0), __border_righti = int(N); i < __border_righti; i++) {
        for (int j = int(0), __border_rightj = int(M); j < __border_rightj;
             j++) {
          printf("%d%c", g[i][j], " \n"[j == M - 1]);
        }
      }
    }
    return;
  }
  for (int i = int(k), __border_righti = int(N * M); i < __border_righti; i++) {
    swap(a[i], a[k]);
    dfs(k + 1, N, M);
    swap(a[i], a[k]);
  }
}
void chk(int N, int M) {
  int k = 1;
  for (int i = int(0), __border_righti = int(N * M); i < __border_righti; i++) {
    a[i] = k++;
  }
  dfs(0, N, M);
}
int main() {
  scanf("%d%d", &N, &M);
  if (N <= 3 && M <= 3) {
    if (N == 1 && M == 1) {
      printf("YES\n1\n");
      return 0;
    } else if (N == 3 && M == 3) {
      printf("YES\n1 3 4\n5 7 6\n9 2 8\n");
    } else {
      printf("NO\n");
    }
  } else if (N == 1) {
    printf("YES\n");
    int k = (M & 1) ? M : M - 1;
    for (int i = k; i >= 1; i -= 2) {
      printf("%d ", i);
    }
    for (int i = (M & 1) ? M - 1 : M; i >= 2; i -= 2) {
      printf("%d%c", i, " \n"[i == 2]);
    }
  } else if (M == 1) {
    printf("YES\n");
    int k = (N & 1) ? N : N - 1;
    for (int i = k; i >= 1; i -= 2) {
      printf("%d\n", i);
    }
    for (int i = (N & 1) ? N - 1 : N; i >= 2; i -= 2) {
      printf("%d\n", i);
    }
  } else {
    int k = 1;
    for (int i = int(0), __border_righti = int(N); i < __border_righti; i++) {
      for (int j = int(0), __border_rightj = int(M); j < __border_rightj; j++) {
        G[i].push_back(k++);
      }
    }
    if (N >= 4) {
      for (int j = 1; j < M; j += 2) {
        int a = G[0][j], b = G[1][j];
        for (int k = int(0), __border_rightk = int(N - 2); k < __border_rightk;
             k++) {
          G[k][j] = G[k + 2][j];
        }
        G[N - 2][j] = a;
        G[N - 1][j] = b;
      }
      for (int i = 1; i < N; i += 2) {
        int a = G[i][0];
        for (int k = int(0), __border_rightk = int(M - 1); k < __border_rightk;
             k++) {
          G[i][k] = G[i][k + 1];
        }
        G[i][M - 1] = a;
      }
    } else if (M >= 4) {
      for (int i = 1; i < N; i += 2) {
        int a = G[i][0], b = G[i][1];
        for (int k = int(0), __border_rightk = int(M - 2); k < __border_rightk;
             k++) {
          G[i][k] = G[i][k + 2];
        }
        G[i][M - 2] = a;
        G[i][M - 1] = b;
      }
      for (int j = 1; j < M; j += 2) {
        int a = G[0][j];
        for (int k = int(0), __border_rightk = int(N - 1); k < __border_rightk;
             k++) {
          G[k][j] = G[k + 1][j];
        }
        G[N - 1][j] = a;
      }
    }
    printf("YES\n");
    for (int i = int(0), __border_righti = int(N); i < __border_righti; i++) {
      for (int j = int(0), __border_rightj = int(M); j < __border_rightj; j++) {
        printf("%d%c", G[i][j], " \n"[j == M - 1]);
      }
    }
  }
  return 0;
}
