#include <stdio.h>
int main()
{
	int a[200001],b[200001],c[200001],e[200001];
	int n,m,i,j,k,d,f,g;
	scanf ("%d%d",&n,&m);
        d=f=g=0;
	for (i=0;i<m;i++)
	{
		scanf ("%d%d",&a[i],&b[i]);
		if (b[i]==n) c[d++]=a[i];
		if (a[i]==1) e[f++]=b[i];
	}
	if (c[0]==0||e[0]==0) printf ("IMPOSSIBLE\n");
	else {for (i=0;i<d;i++){
	if (g==1)break;
	for (j=0;j<f;j++)
	{
		if (c[i]==e[j]) 	g=1;
	}
}
if (g==1) printf ("POSSIBLE\n");
else printf ("IMPOSSIBLE\n");}
return 0;
}
