/*
    Author: Aryan Yadav
*/
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define mod 1000000007
#define f(i, a, b) for (long long i = a; i < b; i++)
#define rep(i, a, b) for (long long i = a; i <= b; i++)
#define fm(i, a, b) for (long long i = a; i > b; i--)
#define repm(i, a, b) for (long long i = a; i >= b; i--)
#define vi vector<int>
#define vl vector<long long>
#define vs vector<string>
#define pqmaxi priority_queue<int>
#define pqmaxl priority_queue<ll>
#define pqmini priority_queue<int, vi, greater<int>>
#define pqminl priority_queue<ll, vl, greater<ll>>
#define all(x) x.begin(), x.end()
#define test     \
    ll test;     \
    cin >> test; \
    while (test--)
#define pb(i) push_back(i)
#define mp(i, j) make_pair(i, j)
#define fast                     \
    ios::sync_with_stdio(false); \
    cin.tie(NULL)

int main()
{
    fast;
    int n, m, t1;
    cin >> n >> m >> t1;
    int cap = n;
    ll prev = 0;
    f(i, 0, m)
    {
        ll a, b;
        cin >> a >> b;
        cap -= (a - prev);
        cap = max(0, cap);
        if (cap == 0)
        {
            cout << "No";
            exit(0);
        }
        f(j, a, b)
        {
            cap += 1;
        }
        cap = min(cap, n);
        prev = b;
    }
    cap -= (t1 - prev);
    if (cap <= 0)
    {
        cout << "No";
    }
    else
    {
        cout << "Yes";
    }
}

//#include <atcoder/all>
//using namespace atcoder;
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for(int i=0; i<n; i++)
#define REPR(i, n) for(int i=n-1; i>=0; i--)
#define FOR(i, m, n) for(int i=m; i<n; i++)
#define ALL(v) v.begin(), v.end()
#define SIZE(x) int(x.size()) 
#define bit(n) (1LL<<(n))
#define FIX(d) fixed << setprecision(d)
using P = pair<int, int>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF = 2e9;
const ll LINF = (1LL<<60);

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n,m; cin >> n >> m;
  if(n==1 && m==0){
    cout << "1 2\n";
    return 0;
  }
  if(m<0 || m>=n-1){
    cout << "-1\n";
    return 0;
  }

  vector<int> l(n), r(n);
  l[0] = 1;
  r[0] = 2;
  FOR(i,1,n){
    l[i] = r[i-1]+2;
    r[i] = l[i]+1;
  }

  if(m>0) r[0] = r[m+1]+1;
  
  REP(i,n){
    cout << l[i] << " " << r[i] <<'\n';
  }
  return 0;
}
