#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; if (H == 2) { cout << "Yes" << '\n'; rep(i, W) cout << i + 1 << " \n"[i == W - 1]; rep(i, W) cout << 2 * W - i << " \n"[i == W - 1]; } else if (W == 2) { cout << "Yes" << '\n'; rep(i, H) cout << i + 1 << ' ' << 2 * W - i << '\n'; } else if (H == 3 and W == 3) { cout << "Yes" << '\n'; cout << "1 5 3\n9 8 7\n4 2 6\n"; } else { cout << "No" << '\n'; } } int main() { ios::sync_with_stdio(false); cin.tie(0); int tt = 1; while (tt--) solve(); return 0; }