#include <bits/stdc++.h>
using namespace std;

int N, M;

int main()
{
    cin >> N >> M;
    vector<int> a(N+1, 0); 
    for (int i=0; i<M; i++)
    {
        int s, t;
        cin >> s >> t;
        if (s == 1) a[t] |= 1;
        if (t == N) a[s] |= 2;
    }
    for (auto i : a) if (i == 3)
    {
        cout << "POSSIBLE" << endl;
        return 0;
    }
    cout << "IMPOSSIBLE" << endl;
    return 0;
}