#include using namespace std; using ll = long long; const ll mod = 1e9 + 7; const int N = 200005; const int INF = 0x3f3f3f3f; int main() { ll Q, K; cin >> Q >> K; if (2 * K < Q + 3) { cout << "No\n"; return 0; } ll x = min(Q, K - 1); ll y = Q - x; cout << "Yes\n"; for (int i = 0; i < x; i++) cout << "1 2\n"; for (int i = 0; i < y; i++) cout << "3 4\n"; return 0; }