#include <iostream>
#include <fstream>
#include <vector>

using namespace std;

typedef long long ll;


int main (void)
{
    //freopen("in.txt", "r", stdin);
    int N, M; cin >> N; cin >> M;
    bool possible = false;
    vector<pair <int, int> > connections;
    
    for (int i = 0; i < M; i++)
    {
        int first_, second_;
        pair <int, int> connection;
        cin >> first_; cin >> second_;
        connection = make_pair(first_, second_);
        connections.push_back(connection);
    }

    //vector< pair <int, int> >:: iterator it = connections.begin();
    for (int i = 0; i < connections.size(); i++)
    {
        if (connections[i].first == 1)
        {
            int midle = connections[i].second;
            for (int j = 0; j < connections.size(); j++)
            {
                if(connections[j].first == midle)
                {
                    if (connections[j].second == N)
                    {
                        possible = true;
                    }            
                }
            }          
        } 
    }
    if(possible) cout << "POSSIBLE";
    else cout << "IMPOSSIBLE";
}