#include using namespace std; using ll = long long; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); ll n, K; cin >> n >> K; ll sum = n * (n + 1) / 2; if (sum % K != 0) { cout << "No\n"; return 0; } vector< vector > ans(K); for (int i = 0; i < n / K; i++) { for (int j = 0; j < K; ++j) { ans[j].push_back(i * K + (i + j) % K + 1); } } cout << "Yes\n"; for (int i = 0; i < ans.size(); i++) { for (int j = 0; j < ans[i].size(); ++j) { cout << ans[i][j] << " \n"[j + 1 == ans[i].size()]; } } return 0; }