import sys

from collections import Counter



# sys.stdin = open('c1.in')





def read_int_list():

    return list(map(int, input().split()))





def read_str_list():

    return input().split()





def read_int():

    return int(eval(input()))





def read_str():

    return eval(input())





n, m = read_int_list()

c = Counter()



for i in range(m):

    a, b = read_int_list()

    if a == 1:

        c[b] += 1

    if b == n:

        c[a] += 1



res = 'IMPOSSIBLE'

if 2 in list(c.values()):

    res = 'POSSIBLE'

print(res)

import sys

from collections import Counter





# sys.stdin = open('c1.in')





def read_int_list():

    return list(map(int, input().split()))





def read_str_list():

    return input().split()





def read_int():

    return int(eval(input()))





def read_str():

    return eval(input())





def solve():

    n, m = read_int_list()

    c = Counter()

    for i in range(m):

        a, b = read_int_list()

        if a == 1:

            c[b] += 1

        if b == n:

            c[a] += 1



    if 2 in list(c.values()):

        return 'POSSIBLE'

    return 'IMPOSSIBLE'





res = solve()

print(res)

import sys
from collections import Counter

# sys.stdin = open('c1.in')
def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


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


def read_str():
    return eval(input())


n, m = read_int_list()
c = Counter()
for i in range(m):
    a, b = read_int_list()
    if a == 1:
        c[b] += 1
    if b == n:
        c[a] += 1
res = "IMPOSSIBLE"
if 2 in list(c.values()):
    res = "POSSIBLE"
print(res)

import sys
from collections import Counter

# sys.stdin = open('c1.in')
def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


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


def read_str():
    return eval(input())


def solve():
    n, m = read_int_list()
    c = Counter()
    for i in range(m):
        a, b = read_int_list()
        if a == 1:
            c[b] += 1
        if b == n:
            c[a] += 1
    if 2 in list(c.values()):
        return "POSSIBLE"
    return "IMPOSSIBLE"


res = solve()
print(res)

-n, m = read_int_list() -c = Counter() -for i in range(m): -    a, b = read_int_list() -    if a == 1: -        c[b] += 1 -    if b == n: -        c[a] += 1 -res = "IMPOSSIBLE" -if 2 in list(c.values()): -    res = "POSSIBLE" +def solve(): +    n, m = read_int_list() +    c = Counter() +    for i in range(m): +        a, b = read_int_list() +        if a == 1: +            c[b] += 1 +        if b == n: +            c[a] += 1 +    if 2 in list(c.values()): +        return "POSSIBLE" +    return "IMPOSSIBLE" + + +res = solve()