#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); auto no = [&]() -> void {cout << "No\n"; exit(0);}; int N,M,K; cin >> N >> M >> K; int edge = N*(N-1)/2; if(K == 1){ if(M == edge) no(); cout << "Yes\n"; for(int i=0; i= edge-1 || M == 0) no(); cout << "Yes\n"; cout << "1 " << N << "\n",M--; for(int i=0; i> del; for(int i=0; i