#include<bits/stdc++.h> 
using namespace std;
namespace Ruri{
    #define ms(a,b) memset(a,b,sizeof(a))
    #define repi(i,a,b) for(int i=a,bbb=b;i<=bbb;++i)//attention reg int or reg ll ?
    #define repd(i,a,b) for(int i=a,bbb=b;i>=bbb;--i)
    #define reps(s) for(int i=head[s],v=e[i].to;i;i=e[i].nxt,v=e[i].to)
    #define ce(i,r) i==r?'\n':' '
    #define pb push_back 
    #define all(x) x.begin(),x.end()
    #define gmn(a,b) a=min(a,b)
    #define gmx(a,b) a=max(a,b)
    #define fi first
    #define se second                         
    typedef long long ll;
    typedef unsigned long long ull;
    typedef double db;
    const int infi=1e9;//infi较大，注意涉及inf相加时爆int
    const ll infl=4e18;
    inline ll ceil_div(ll a,ll b){ return (a+b-1)/b; }
    inline ll pos_mod(ll a,ll b){ return (a%b+b)%b; }
    //std::mt19937 rnd(time(0));//std::mt19937_64 rnd(time(0));
}
using namespace Ruri;
namespace Read{
    #define ss(a) scanf("%s",a)
    inline int ri(){ int x; scanf("%d",&x); return x; }
    inline ll rl(){ ll x;  scanf("%lld",&x); return x; }
    inline db rd(){ db x; scanf("%lf",&x); return x; }
}
namespace DeBug{
    #define pr(x) cout<<#x<<": "<<(x)<<endl
    #define pra(x,a,b) cout<<#x<<": "<<endl; \
            repi(i,a,b) cout<<x[i]<<" ";     \
            puts("");   
    #define FR(a) freopen(a,"r",stdin)
    #define FO(a) freopen(a,"w",stdout)
}
using namespace Read;
using namespace DeBug;
const int MAX_N=2e5+5;
int n,m;
map<int,vector<int> >mp;
set<int> s;
vector<int> add;
int main()
{
    n=ri(),m=ri();
    repi(i,1,m){
        int x=ri(),y=ri();
        mp[x].pb(y);
    }
    s.insert(n);
    for(auto p:mp){
        add.clear();
        for(auto y:p.se)if(s.count(y-1)||s.count(y+1)) add.pb(y);
        for(auto y:p.se)if(s.count(y)) s.erase(y);
        for(auto y:add) s.insert(y);
    }
    printf("%d\n",(int)s.size());

    return 0;
}
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n - 1); i >= 0; i--)
#define ALL(v) v.begin(), v.end()
using namespace std;
using P = pair<int, int>;
typedef long long 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 dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main() {
  int n, m;
  cin >> n >> m;
  if(n == 1 && m == 0){
    cout << 1 << " " << 2 << endl;
    return 0;
  }
  if(m == n || m < 0 || m == n-1){
    cout << -1 << endl;
    return 0;
  }
  int fi = 3;
  int se = 5;
  vector<P> ans(n-1);
  rep(i, n-1){
    ans[i] = {fi, se};
    fi += 4;
    se += 4;
  }
  if(m == 0){
    ans.push_back({1, 2});
    rep(i, n){
      cout << ans[i].first << " " << ans[i].second << endl;
    }
    return 0;
  }
  int last = 4 * (n-1) +2;
  int cn = n - 2 - m;
  last -= 4 * cn;
  ans.push_back({1, last});
  rep(i, n){
    cout << ans[i].first << " " << ans[i].second << endl;
  }
}