import sys, re

from collections import deque, defaultdict, Counter

from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians

from itertools import permutations, combinations, product, accumulate

from operator import itemgetter, mul

from copy import deepcopy

from string import ascii_lowercase, ascii_uppercase, digits

from fractions import gcd

from bisect import bisect

from heapq import heappush, heappop



def input(): return sys.stdin.readline().strip()

def INT(): return int(eval(input()))

def MAP(): return list(map(int, input().split()))

def LIST(): return list(map(int, input().split()))

sys.setrecursionlimit(10 ** 9)

INF = float('inf')

mod = 10 ** 9 + 7



N, M = MAP()

ab = [LIST() for _ in range(M)]



def dijkstra(E, start):

    N_d = len(E)

    dist = [INF] * N_d

    dist[start] = 0

    q = [(0, start)]

    while q:

        dist_v, v = heappop(q)

        if dist[v] != dist_v:

            continue

        for u, dist_vu in E[v]:

            dist_u = dist_v + dist_vu

            if dist_u < dist[u]:

                dist[u] = dist_u

                heappush(q, (dist_u, u))

    return dist



E = [[] for _ in range(N)]



for a, b in ab:

	E[a-1].append((b-1, 1))



d = dijkstra(E, 0)



if d[-1] <= 2:

	print("POSSIBLE")

else:

	print("IMPOSSIBLE")

import sys, re

from collections import deque, defaultdict, Counter

from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians

from itertools import accumulate, permutations, combinations, product

from operator import itemgetter, mul

from copy import deepcopy

from string import ascii_lowercase, ascii_uppercase, digits

from bisect import bisect, bisect_left

from fractions import gcd

from heapq import heappush, heappop



def input(): return sys.stdin.readline().strip()

def INT(): return int(eval(input()))

def MAP(): return list(map(int, input().split()))

def LIST(): return list(map(int, input().split()))

sys.setrecursionlimit(10 ** 9)

INF = float('inf')

MOD = 10 ** 9 + 7



N, M = MAP()

graph = defaultdict(list)



for _ in range(M):

	a, b = MAP()

	graph[a-1].append(b-1)

	graph[b-1].append(a-1)





for i in graph[0]:

	if N-1 in graph[i]:

		print("POSSIBLE")

		break

else:

	print("IMPOSSIBLE")

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect
from heapq import heappush, heappop


def input():
    return sys.stdin.readline().strip()


def INT():
    return int(eval(input()))


def MAP():
    return list(map(int, input().split()))


def LIST():
    return list(map(int, input().split()))


sys.setrecursionlimit(10**9)
INF = float("inf")
mod = 10**9 + 7
N, M = MAP()
ab = [LIST() for _ in range(M)]


def dijkstra(E, start):
    N_d = len(E)
    dist = [INF] * N_d
    dist[start] = 0
    q = [(0, start)]
    while q:
        dist_v, v = heappop(q)
        if dist[v] != dist_v:
            continue
        for u, dist_vu in E[v]:
            dist_u = dist_v + dist_vu
            if dist_u < dist[u]:
                dist[u] = dist_u
                heappush(q, (dist_u, u))
    return dist


E = [[] for _ in range(N)]
for a, b in ab:
    E[a - 1].append((b - 1, 1))
d = dijkstra(E, 0)
if d[-1] <= 2:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop


def input():
    return sys.stdin.readline().strip()


def INT():
    return int(eval(input()))


def MAP():
    return list(map(int, input().split()))


def LIST():
    return list(map(int, input().split()))


sys.setrecursionlimit(10**9)
INF = float("inf")
MOD = 10**9 + 7
N, M = MAP()
graph = defaultdict(list)
for _ in range(M):
    a, b = MAP()
    graph[a - 1].append(b - 1)
    graph[b - 1].append(a - 1)
for i in graph[0]:
    if N - 1 in graph[i]:
        print("POSSIBLE")
        break
else:
    print("IMPOSSIBLE")

-from itertools import permutations, combinations, product, accumulate +from itertools import accumulate, permutations, combinations, product +from bisect import bisect, bisect_left -from bisect import bisect -mod = 10**9 + 7 +MOD = 10**9 + 7 -ab = [LIST() for _ in range(M)] - - -def dijkstra(E, start): -    N_d = len(E) -    dist = [INF] * N_d -    dist[start] = 0 -    q = [(0, start)] -    while q: -        dist_v, v = heappop(q) -        if dist[v] != dist_v: -            continue -        for u, dist_vu in E[v]: -            dist_u = dist_v + dist_vu -            if dist_u < dist[u]: -                dist[u] = dist_u -                heappush(q, (dist_u, u)) -    return dist - - -E = [[] for _ in range(N)] -for a, b in ab: -    E[a - 1].append((b - 1, 1)) -d = dijkstra(E, 0) -if d[-1] <= 2: -    print("POSSIBLE") +graph = defaultdict(list) +for _ in range(M): +    a, b = MAP() +    graph[a - 1].append(b - 1) +    graph[b - 1].append(a - 1) +for i in graph[0]: +    if N - 1 in graph[i]: +        print("POSSIBLE") +        break