#include using namespace std; using ll = long long; using P = pair; #define fix(x) fixed << setprecision(x) #define asc(x) x, vector, greater #define rep(i, n) for(ll i = 0; i < n; i++) #define all(x) (x).begin(),(x).end() templatebool chmin(T&a, const T&b){if(a>b){a=b;return 1;}return 0;} templatebool chmax(T&a, const T&b){if(a> h >> w; cout << "Yes\n"; vector> a(h,vector(w)); rep(i,h){ rep(j,w) a[i][j] = i*w+j+1; if(i&1) reverse(all(a[i])); } rep(i,w){ if(i&1) continue; rep(j,h/2) swap(a[j][i], a[h-j-1][i]); } rep(i,h){ rep(j,w) cout << a[i][j] << " "; cout << '\n'; } return 0; }