#include<stdio.h>
#include<malloc.h>
void fun(int a[][2],int m,int sta,int end,int time,int *judg)
{

	int i;
	for(i=0;i<m;i++)
	{
		if(time<=2&&a[i][1]==end&&a[i][0]==sta) {printf("POSSIBLE");*judg=1;exit(1);}
		if(a[i][0]==sta) fun(a,m,a[i][1],end,time+1,judg);
	}
}

int main()
{
	int n,m;
	scanf("%d%d",&n,&m);
	int (*a)[2]=(int (*)[2])malloc(m*2*sizeof(int));
	int i,j,judg=0;
	for(i=0;i<m;i++)
	   for(j=0;j<2;j++)
	      scanf("%d",&a[i][j]);
	fun(a,m,1,n,1,&judg);
	printf("%d\n",judg);
	if(judg==0) printf("IMPOSSIBLE");
}