import sys

def 解():

    iN,iM = [int(_) for _ in input().split()]

    a1 = [0]*iN

    aN = [0]*iN

    aAB = [[int(_) for _ in sLine.split()] for sLine in sys.stdin.readlines()]

    for a,b in aAB:

        if a == 1:

            a1[b] = 1

        if b == iN:

            aN[a] = 1

    for i in range(iN):

        if a1[i] and aN[i]:

            print("POSSIBLE")

            exit()

    print("IMPOSSIBLE")

解()

import sys

input = sys.stdin.readline

def 解():

    iN,iM = [int(_) for _ in input().split()]

    a1 = [0]*iN

    aN = [0]*iN

    for i in range(iM):

        a,b = [int(_) for _ in input().split()]

        if a == 1:

            a1[b] = 1

        if b == iN:

            aN[a] = 1

    for i in range(iN):

        if a1[i] and aN[i]:

            print("POSSIBLE")

            exit()

    print("IMPOSSIBLE")

解()

import sys


def 解():
    iN, iM = [int(_) for _ in input().split()]
    a1 = [0] * iN
    aN = [0] * iN
    aAB = [[int(_) for _ in sLine.split()] for sLine in sys.stdin.readlines()]
    for a, b in aAB:
        if a == 1:
            a1[b] = 1
        if b == iN:
            aN[a] = 1
    for i in range(iN):
        if a1[i] and aN[i]:
            print("POSSIBLE")
            exit()
    print("IMPOSSIBLE")


解()

import sys

input = sys.stdin.readline


def 解():
    iN, iM = [int(_) for _ in input().split()]
    a1 = [0] * iN
    aN = [0] * iN
    for i in range(iM):
        a, b = [int(_) for _ in input().split()]
        if a == 1:
            a1[b] = 1
        if b == iN:
            aN[a] = 1
    for i in range(iN):
        if a1[i] and aN[i]:
            print("POSSIBLE")
            exit()
    print("IMPOSSIBLE")


解()

+ +input = sys.stdin.readline -    aAB = [[int(_) for _ in sLine.split()] for sLine in sys.stdin.readlines()] -    for a, b in aAB: +    for i in range(iM): +        a, b = [int(_) for _ in input().split()]