#include using namespace std; using ll = long long; const ll mod = 1e9 + 7; const int N = 200005; const int INF = 0x3f3f3f3f; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, k; cin >> n >> k; k -= 2; if (n / 2 > k) { if (k < 3) { cout << "No\n"; } else { cout << "Yes\n"; cout << "1 2\n"; cout << "1 2\n"; cout << "3 4\n"; cout << "4 5\n"; cout << "4 5\n"; n -= 5; while (n--) cout << "6 7\n"; } } else { cout << "Yes\n"; cout << "1 2\n"; n--; if (n) { cout << "1 2\n"; n--; } while (n) { cout << "3 4\n"; n--; if (!n) break; cout << "1 2\n"; n--; } } return 0; }