#include #include using namespace std; using ll = long long; int Q, K; int main(void){ ios::sync_with_stdio(false); cin.tie(nullptr); cin >> Q >> K; // [0, 0, 1, 1, 1] // [0, 1, 1, 1, 0] // [1, 0, 1, 0, 1] // [1, 1, 0, 1, 0] // 2, 2, 3, 4, 4, 5, 5 .. if(Q <= 2 && K > 2){ cout << "No\n"; return 0; } if(Q > 2 && K < Q / 2 + 2){ cout << "No\n"; return 0; } cout << "Yes\n"; vector> ans; ans.push_back({0, 1}); if(Q > 1)ans.push_back({0, 2}); for(int i = 0;i < Q - 2;i++){ ans.push_back({i % 2 + 1, i % 2 + 3}); } for(auto [a, b] : ans){ cout << a + 1 << " " << b + 1 << "\n"; } return 0; }