// Slower C++ solution:
#include<cstdio>

#include<queue>

#include<vector>

#include<algorithm>

#include<cstring>

#define pa pair<int,int>

#define mp make_pair

using namespace std;

inline int read(){int x=0,f=1; char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-') f=-1; ch=getchar();} while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();} return x*f;}

const int maxn=200005;

struct edge{

	int link,next;

}e[maxn];

int head[maxn],tot,m,n; 

inline void insert(int u,int v){

	e[++tot]=(edge){v,head[u]};

	head[u]=tot;

}

inline void init(){

	n=read(); m=read();

	for (int i=1;i<=m;i++){

		int u=read(),v=read();

		insert(u,v);

	}

}

int dis[maxn];

bool vis[maxn];

priority_queue<pa, vector<pa>, greater<pa> > heap; 

inline void solve(){

	memset(dis,127/3,sizeof(dis));

	dis[1]=0; heap.push(mp(0,1));

	while (!heap.empty()){

		int u=heap.top().second; heap.pop();

		if (vis[u]) continue;

		vis[u]=1;

		for (int i=head[u];i;i=e[i].next){

			int v=e[i].link;

			if (dis[v]>dis[u]+1){

				dis[v]=dis[u]+1;

				if (!vis[v]){

					heap.push(mp(dis[v],v));

				}

			}

		}

	}

	if (dis[n]==2) puts("POSSIBLE");

		else puts("IMPOSSIBLE");

}

int main(){

	init();

	solve();

	return 0;

} 

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

#define LL long long

#define PII pair<int,int>

#define PIL pair<int,LL>

#define PLI pair<LL,int>

#define PIII pair<int,PII>

#define PLL pair<LL,LL>

#define PLII pair<LL,PII>

#define VI vector<int>

#define VVI vector<VI>

#define VL vector<LL>

#define VVL vector<VL>

#define VPII vector<PII>

#define FF first

#define SS second

#define MP make_pair

#define PB push_back

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

#define watch(x) cout<<(#x)<<" = "<<(x)<<'\n'

#define mset(a,v) memset(a,v,sizeof(a))

#define setp(x) cout<<fixed<<setprecision(x)

#define EPS 0.00000000001

#define PI acos(-1)

#define loop(i,b,n) for(int i=b;i<n;++i)

#define rev_loop(i,b,n) for(int i=b;i>=n;--i)

using namespace std;



const int MOD = 1e9 + 7;

const LL MX = 1e9;

const LL INF = 1e9;



void print_a(VI v)

{

    if(v.size()) cout<<v[0];

    loop(i,1,v.size()) cout<<' '<<v[i];

    cout<<'\n';

}



VVI init_vvi(int n, int m, int val)

{

    return VVI(n,VI(m,val));

}



VVL init_vvl(int n, int m, LL val)

{

    return VVL(n,VL(m,val));

}



int main()

{

    //ofstream out("output.txt");

    //ifstream in("input.txt");

    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);



    int n,m;

    cin>>n>>m;

    int u,v;



    VI g[n+1];

    loop(i,0,m)

    {

        cin>>u>>v;

        g[u].PB(v);

    }



    int f = 0;

    for(int u1 : g[1])

    {

        if(binary_search(all(g[u1]),n)) {f = 1; break;}

    }



    if(f) cout<<"POSSIBLE\n";

    else cout<<"IMPOSSIBLE\n";



    /*

    int t,n;

    cin>>t;

    while(t--)

    {

        cin>>n;

        int a[n];

        loop(i,0,n)

        {

            cin>>a[i];

        }

    }

    */



    /*

    int n;

    cin>>n;

    int a[n];

    loop(i,0,n)

    {

        cin>>a[i];

    }

    */



    /*

    cout<<ans<<'\n';



    if(f) cout<<"YES\n";

    else cout<<"NO\n";



    if(f) cout<<"Yes\n";

    else cout<<"No\n";

    */



    return 0;

}