#include using namespace std; #ifdef _RUTHEN #include #else #define show(...) true #endif using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) template using V = vector; void solve() { int H, W; cin >> H >> W; V> ans(H, V(W)); int c = 1; rep(i, H) { if (i % 2 == 0) { rep(j, W) ans[i][j] = c++; } else { rep(j, W) ans[i][W - 1 - j] = c++; } } show(ans); cout << "Yes" << '\n'; rep(i, H) rep(j, W) cout << (j % 2 == 1 ? ans[H - 1 - i][j] : ans[i][j]) << " \n"[j == W - 1]; } int main() { ios::sync_with_stdio(false); cin.tie(0); int tt = 1; while (tt--) solve(); return 0; }