#include #include using namespace atcoder; using namespace std; using ll=long long; using ld=long double; ld pie=3.141592653589793; ll inf=2000000000000000000; ll mod=998244353; int main(){ ll n,k; cin >> n >> k; if (n==1) { cout << "Yes" << endl; cout << 1 << endl; return 0; } if (k==1) { cout << "Yes" << endl; for (ll i = 0; i < n; i++) { cout << i+1 << ' '; } cout << endl; return 0; } if ((n/k)%2) { cout << "No" << endl; return 0; } cout << "Yes" << endl; for (ll i = 0; i < k; i++) { for (ll j = 0; j < n/(k*2); j++) { cout << i*(n/(k*2))+j+1 << ' '<< n-(i*(n/(k*2))+j) << ' '; } cout << endl; } }