#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,n) for(int i=0; i=b; --i) #define ALL(c) (c).begin(), (c).end() typedef long long ll; typedef vector VI; typedef vector VL; typedef vector VVI; typedef vector VVL; typedef pair P; typedef pair PL; int main() { ll n, m; cin >> n >> m; ll x = n / 2, y = n - x; if (m > x * y || m < n-1){ cout << "NO" << endl; return 0; } cout << "YES" << endl; REP(i,x) cout << i + 1 << endl; REP(i,y) cout << 100000 - i << endl; REP(i,x){ cout << i + 1 << " " << x + 1 << endl; m--; } FOR(i,x+2,n){ cout << i << " " << 1 << endl; m--; } FOR(i,2,x){ FOR(j,x+2,n){ if (m == 0) break; cout << i << " " << j << endl; m--; } } return 0; }