#include using namespace std; const int INF = 1000000; int main(){ int N, K; cin >> N >> K; if (K == 1){ cout << "No" << endl; } else if (K == 2){ if (N % 2 == 0){ cout << "Yes" << endl; for (int i = 0; i < N - 1; i++){ int w; if (i % 2 == 0){ w = INF; } else { w = -(INF + 1); } cout << i + 1 << ' ' << i + 2 << ' ' << w << endl; } } else { cout << "No" << endl; } } else if (K == N - 1){ cout << "No" << endl; } else { cout << "Yes" << endl; for (int i = 0; i < N - 3; i++){ cout << i + 1 << ' ' << i + 2 << ' ' << -2 << endl; } cout << N - 2 << ' ' << N - 1 << ' ' << K * 2 - 3 << endl; cout << N - 2 << ' ' << N << ' ' << K * 2 - 3 << endl; } }