#define _USE_MATH_DEFINES #include using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(0); int n, k; cin >> n >> k; if (n % 2 != 0) { cout << "No\n"; return 0; } if ((n / k) % 2 != 0) { cout << "No\n"; return 0; } int t = n / k / 2; vector> p; for (int i = 0; i < n / 2; i++) { p.emplace_back(i, n - 1 - i); } cout << "Yes\n"; int c = 0; for (int i = 0; i < k; i++) { for (int j = 0; j < t; j++) { if (j > 0) cout << " "; cout << p[c].first + 1 << " " << p[c].second + 1; c++; } cout << '\n'; } return 0; }