# -*- coding: utf-8 -*-



# AtCoder Beginner Contest

# Problem C



if __name__ == '__main__':

    n, m = list(map(int, input().split()))

    set_a = set()

    set_b = set()



    for i in range(m):

        a, b = list(map(int, input().split()))



        if a == 1:

            set_b.add(b)

        elif b == n:

            set_a.add(a)



    if set_a & set_b:

        print('POSSIBLE')

    else:

        print('IMPOSSIBLE')

# -*- coding: utf-8 -*-





def main():

    import sys

    input = sys.stdin.readline



    n, m = list(map(int, input().split()))

    first = list()

    second = list()



    for i in range(m):

        ai, bi = list(map(int, input().split()))



        if ai == 1:

            first.append(bi)



        if bi == n:

            second.append(ai)



    ans = set(first) & set(second)



    if len(ans) > 0:

        print('POSSIBLE')

    else:

        print('IMPOSSIBLE')





if __name__ == '__main__':

    main()

# -*- coding: utf-8 -*-
# AtCoder Beginner Contest
# Problem C
if __name__ == "__main__":
    n, m = list(map(int, input().split()))
    set_a = set()
    set_b = set()
    for i in range(m):
        a, b = list(map(int, input().split()))
        if a == 1:
            set_b.add(b)
        elif b == n:
            set_a.add(a)
    if set_a & set_b:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")

# -*- coding: utf-8 -*-
def main():
    import sys

    input = sys.stdin.readline
    n, m = list(map(int, input().split()))
    first = list()
    second = list()
    for i in range(m):
        ai, bi = list(map(int, input().split()))
        if ai == 1:
            first.append(bi)
        if bi == n:
            second.append(ai)
    ans = set(first) & set(second)
    if len(ans) > 0:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")


if __name__ == "__main__":
    main()

-# AtCoder Beginner Contest -# Problem C -if __name__ == "__main__": +def main(): +    import sys + +    input = sys.stdin.readline -    set_a = set() -    set_b = set() +    first = list() +    second = list() -        a, b = list(map(int, input().split())) -        if a == 1: -            set_b.add(b) -        elif b == n: -            set_a.add(a) -    if set_a & set_b: +        ai, bi = list(map(int, input().split())) +        if ai == 1: +            first.append(bi) +        if bi == n: +            second.append(ai) +    ans = set(first) & set(second) +    if len(ans) > 0: + + +if __name__ == "__main__": +    main()