// Original C++ solution (slower):
#include "bits/stdc++.h"

using namespace std;

#define INF 1000000000

#define rep(i, n) for(int i = 0; i < n; i++)

#define ALL(x) (x).begin(), (x).end()  //昇順

#define RALL(x) (x).rbegin(), (x).rend() // 降順

const long long mod = 1e9+7;

typedef priority_queue<int> PQ;

typedef vector<long long> VL;

typedef vector<int> VI;  // VI a(n);

typedef vector<string> VS;  

typedef vector<char> VC; 

typedef vector<VS> VSS;

typedef vector<VC> VCC;    

typedef vector<VI> VVI;   // VVI a(n,vector<int>(m)) n * m 

typedef vector<VL> VVL;

typedef pair<int, int> PII;

typedef map<int, int> MP;   //MP a;

typedef vector<pair<int, int> > PS;

typedef long long ll;  //ll とdoubleは違う

template <class T>  // chmax(max, a);

bool chmax(T &a, const T &b)

{

    if (a < b)

    {

        a = b;

        return 1;

    }

    return 0;

}

template <class T> //chmin(min,a)

bool chmin(T &a, const T &b)

{

    if (b < a)

    {

        a = b;

        return 1;

    }

    return 0;

}

template<typename T>   // operator << (cout,a);

ostream& operator << (ostream& os, vector<T>& v) {

    os << "{";

    rep(i, (int)v.size()) { os << v[i] << (i < v.size() - 1 ? ", " : ""); }

    os << "}";

    return os;

}



int main(){

    ll x,y,n,m,h,k,w,max=-1000000001,min=1000000001,sum=0;

    string s,t;

    cin >> n >> m;

    VL a(m);

    VL b(200000);

    vector<bool> ans(m,false);

    rep(i,m){

        cin >> a[i] >> b[i];

	}

    rep(i,m){

        if(a[i] == 1){

            ans[b[i]] = true;

        }

    }

    rep(i,m){

        if(b[i]==n && ans[a[i]]){

            cout << "POSSIBLE" << endl;

            return 0;

        }

    }

   

    cout << "IMPOSSIBLE" << endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include "bits/stdc++.h"

using namespace std;

#define rep(i, n) for (int i = 0; i < n; i++)

#define rep2(i, l, r) for (int i = (l); i < (r); i++)

#define ALL(x) (x).begin(), (x).end()     //昇順

#define RALL(x) (x).rbegin(), (x).rend()  // 降順

#define pri(x) cout << (x) << "\n"

#define pri2(x, y) cout << (x) << " " << (y) << "\n"

#define pri3(x, y, z) cout << (x) << " " << (y) << " " << (z) << "\n"

const long long mod = 1e9 + 7;

typedef long long ll;

typedef priority_queue<int> PQ;

typedef vector<long long> VL;

typedef vector<bool> VB;

typedef vector<int> VI;  // VI a(n);

typedef vector<double> VD;

typedef vector<string> VS;

typedef vector<char> VC;

typedef vector<VS> VSS;

typedef vector<VC> VCC;

typedef vector<VI> VII;  // VII a(n,VI(m)) n * m

typedef vector<VL> VLL;

typedef pair<int, int> PII;

typedef map<int, int> MP;  // MP a;

typedef vector<pair<ll, ll>> PS;



template <class T, class U>

bool chmax(T &a, U b) {

  if (a <= b) {

    a = b;

    return 1;

  }

  return 0;

}

template <class T, class U>

bool chmin(T &a, U b) {

  if (a > b) {

    a = b;

    return 1;

  }

  return 0;

}

template <typename T>

ostream &operator<<(ostream &os, vector<T> &v) {

  os << "{";

  rep(i, (int)v.size()) { os << v[i] << (i < v.size() - 1 ? ", " : ""); }

  os << "}";

  return os;

}



// g++ -std=c++11 prac.cpp

// operator << (cout,a);

// chmin(min,a)

     

int main() {

  ll n, m, k, x, y , z = 0, h,w, sum = 0, Max = -1, Min = 3e9+1;

  string u;

  bool ok=true;

  cin >> n >> m;

  VL a(m),b(m); VB ans(m,false);

  rep(i,m){

    cin >> a[i] >> b[i];

  }

  // 1 から行ける場所

  rep(i,m){

    if(a[i]==1){

      ans[b[i]]=true;

    }

  }

  //1から行ける場所 からnに行ける場所

  rep(i,m){

    if(b[i]==n && ans[a[i]]){

      pri("POSSIBLE");

      return 0;

    }

  }

  pri("IMPOSSIBLE");

  return 0;

}


// Fastest known solution for this problem: