#include <iostream>
using namespace std;

int n,m;
int cnt[500500];

int main(){
	cin>>n>>m;
	bool found=false;
	for(int i=0;i<m;i++){
		int a,b;
		cin>>a>>b;
		if(a==1){
			cnt[b]++;
			if(cnt[b]==2){
				found=true;
			}
		}
		if(b==n){
			cnt[a]++;
			if(cnt[a]==2){
				found=true;
			}
		}
	}
	if(found){
		cout<<"POSSIBLE"<<endl;
	} else {
		cout<<"IMPOSSIBLE"<<endl;
	}
}