#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 < K - 1; i++){ cout << i + 1 << ' ' << i + 2 << ' ' << -2 << endl; } for (int i = K + 1; i <= N; i++){ cout << K << ' ' << i << ' ' << K * 2 - 3 << endl; } } }