import sys

def 解():

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

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

    dT = {}

    def addTree(dT,a,b):

        if a in dT:

            dT[a].add(b)

        else:

            dT[a] = {b}

    for a,b in aAB:

        addTree(dT,a,b)

        addTree(dT,b,a)

    if  1 not in dT or iN  not in dT:

        print("IMPOSSIBLE")

    elif 0 < len(dT[1] & dT[iN]) :

        print("POSSIBLE")

    else:

        print("IMPOSSIBLE")

解()

import sys

def 解():

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

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

    d1 = set()

    dN = set()

    for a,b in aAB:

        if a == 1 :

            d1.add(b)

        if b == iN:

            dN.add(a)

    if d1 & dN == set():

        print("IMPOSSIBLE")

    else:

        print("POSSIBLE")

解()

import sys


def 解():
    iN, iM = [int(_) for _ in input().split()]
    aAB = [[int(_) for _ in sLine.split()] for sLine in sys.stdin.readlines()]
    dT = {}

    def addTree(dT, a, b):
        if a in dT:
            dT[a].add(b)
        else:
            dT[a] = {b}

    for a, b in aAB:
        addTree(dT, a, b)
        addTree(dT, b, a)
    if 1 not in dT or iN not in dT:
        print("IMPOSSIBLE")
    elif 0 < len(dT[1] & dT[iN]):
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")


解()

import sys


def 解():
    iN, iM = [int(_) for _ in input().split()]
    aAB = [[int(_) for _ in sLine.split()] for sLine in sys.stdin.readlines()]
    d1 = set()
    dN = set()
    for a, b in aAB:
        if a == 1:
            d1.add(b)
        if b == iN:
            dN.add(a)
    if d1 & dN == set():
        print("IMPOSSIBLE")
    else:
        print("POSSIBLE")


解()

-    dT = {} - -    def addTree(dT, a, b): -        if a in dT: -            dT[a].add(b) -        else: -            dT[a] = {b} - +    d1 = set() +    dN = set() -        addTree(dT, a, b) -        addTree(dT, b, a) -    if 1 not in dT or iN not in dT: +        if a == 1: +            d1.add(b) +        if b == iN: +            dN.add(a) +    if d1 & dN == set(): -    elif 0 < len(dT[1] & dT[iN]): +    else: -    else: -        print("IMPOSSIBLE")