// yuki 942 プレゼント配り // 2019.12.5 bal4u #include typedef long long ll; int getchar_unlocked(void); int putchar_unlocked(int c); #define gc() getchar_unlocked() #define pc(c) putchar_unlocked(c) int in() { // 非負整数の入力 int n = 0, c = gc(); do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0'); return n; } void out(int n) { // 非負整数の表示(出力) int i = 0; char b[30]; while (n) b[i++] = n % 10 + '0', n /= 10; while (i--) pc(b[i]); } void outs(char *s) { while (*s) pc(*s++); pc('\n'); } int main() { int N, K, a, b, s, x, f; N = in(), K = in(); if (K == 1) { outs("Yes"); a = 1, x = N; while (--x) out(a++), pc(' '); out(N), pc('\n'); } else { s = N/K; if ((s & 1) || (ll)N*(N+1)%(2*K)) outs("No"); else { outs("Yes"); a = 1, b = N, s = N/K; while (K--) { f = 1, x = s; while (--x) { if (f) out(a++), pc(' '), f = 0; else out(b--), pc(' '), f = 1; } out(b--), pc('\n'); } } } return 0; }