// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

#define fi first

#define se second

#define countof(array) (sizeof(array) / sizeof(array[0]))

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

#define rrep(i,n) for(int i = (n)-1; i >= 0; --i)

#define srep(i,n,s) for(int i = s; i < (n); ++i)

#define rsrep(i,n,s) for(int i = (n)-1; i >= s; --i)

#define all(a) (a).begin(),(a).end()

#define rall(a) (a).rbegin(),(a).rend()

#define aall(a) (a), (a)+countof(a)//for array sorting

#define raall(a) (a), (a)+countof(a), greater<>()

#define show(x) cout<<#x<<" = "<<x<<endl;

#define vfind(v, a) find(all(v), a) != v.end()

#define yn(f) { if (f) puts("YES"); else puts("NO"); }

#define yns(f) { if (f) puts("Yes"); else puts("No"); }

#define show_ary(...) { cout<<#__VA_ARGS__<<" = "; for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }

#define show_pair(...) cout<<#__VA_ARGS__<<" = "<<endl; for (const auto& x : (__VA_ARGS__)) { cout<<"  "<<x.fi<<" : "<<x.se<<endl; }

#define out_ary(...) { for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }

#define argmax(v) distance((v).begin(), max_element(all(v)))

#define argmin(v) distance((v).begin(), min_element(all(v)))

#define vmax(v) *max_element(all(v))

#define vmin(v) *min_element(all(v))

typedef long long int ll;

typedef pair<int, int> P;

typedef vector<P> vpair;

typedef vector<int> vint;

typedef vector<ll> vll;

typedef vector<double> vdouble;

typedef vector<string> vstr;

typedef vector<bool> vbool;

typedef vector<vint> vvint;

typedef vector<vll> vvll;

typedef vector<vstr> vvstr;

typedef vector<vbool> vvbool;

const ll LINF = 2000000000000000000ll;

const int INF = 1000000100;

const ll MOD = 1e9+7;



vint d;

vpair edges[200005];



void dijkstra(int s) {

    priority_queue<P, vector<P>, greater<P>> que;

    d[s] = 0;

    que.push(P(0, s));



    while (que.size()) {

        P p = que.top();

        que.pop();

        int v = p.se;

        if (d[v] < p.fi) continue;

        for (auto e : edges[v]) {

            if (d[e.fi] > d[v] + e.se) {

                d[e.fi] = d[v] + e.se;

                que.push(P(d[e.fi], e.fi));

            }

        }

    }

}



int main() {

    int n, m;

    cin >> n >> m;

    rep(i, m) {

        int a, b;

        cin >> a >> b;

        --a;

        --b;

        edges[a].emplace_back(b, 1);

        edges[b].emplace_back(a, 1);

    }



    d.resize(n, INF);

    dijkstra(0);



    if (d[n-1] <= 2) puts("POSSIBLE");

    else puts("IMPOSSIBLE");

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 6.5000317152030895x):
#include <bits/stdc++.h>

using namespace std;

#define fi first

#define se second

#define countof(array) (sizeof(array) / sizeof(array[0]))

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

#define rrep(i,n) for(int i = (n)-1; i >= 0; --i)

#define srep(i,n,s) for(int i = s; i < (n); ++i)

#define rsrep(i,n,s) for(int i = (n)-1; i >= s; --i)

#define all(a) (a).begin(),(a).end()

#define rall(a) (a).rbegin(),(a).rend()

#define aall(a) (a), (a)+countof(a)//for array sorting

#define raall(a) (a), (a)+countof(a), greater<>()

#define show(x) cout<<#x<<" = "<<x<<endl;

#define vfind(v, a) find(all(v), a) != v.end()

#define yn(f) { if (f) puts("YES"); else puts("NO"); }

#define yns(f) { if (f) puts("Yes"); else puts("No"); }

#define show_ary(...) { cout<<#__VA_ARGS__<<" = "; for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }

#define show_pair(...) cout<<#__VA_ARGS__<<" = "<<endl; for (const auto& x : (__VA_ARGS__)) { cout<<"  "<<x.fi<<" : "<<x.se<<endl; }

#define out_ary(...) { for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }

#define argmax(v) distance((v).begin(), max_element(all(v)))

#define argmin(v) distance((v).begin(), min_element(all(v)))

#define vmax(v) *max_element(all(v))

#define vmin(v) *min_element(all(v))

typedef long long int ll;

typedef pair<int, int> P;

typedef vector<P> vpair;

typedef vector<int> vint;

typedef vector<ll> vll;

typedef vector<double> vdouble;

typedef vector<string> vstr;

typedef vector<bool> vbool;

typedef vector<vint> vvint;

typedef vector<vll> vvll;

typedef vector<vstr> vvstr;

typedef vector<vbool> vvbool;

const ll LINF = 2000000000000000000ll;

const int INF = 1000000100;

const ll MOD = 1e9+7;





int main() {

    int n, m;

    cin >> n >> m;

    vbool from_1(n, false);

    vbool to_N(n, false);

    from_1[0] = true;

    to_N[n-1] = true;

    rep(i, m) {

        int a, b;

        cin >> a >> b;

        if (a > b) swap(a, b);

        if (a == 1) from_1[b-1] = true;

        if (b == n) to_N[a-1] = true;

    }

    rep(i, n) {

        if (from_1[i] & to_N[i]) {

            puts("POSSIBLE");

            return 0;

        }

    }

    puts("IMPOSSIBLE");

    return 0;

}