from collections import defaultdict

from itertools import product, groupby

from math import pi

from collections import deque

from bisect import bisect, bisect_left, bisect_right

INF = 10 ** 10





def main():

    N, M = list(map(int, input().split()))

    graph = defaultdict(list)

    for _ in range(M):

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

        graph[a].append(b)

        graph[b].append(a)



    for a in graph[1]:

        if N in graph.get(a, []):

            print("POSSIBLE")

            return

    print("IMPOSSIBLE")





if __name__ == '__main__':

    main()

from collections import defaultdict, Counter

from itertools import product, groupby, count, permutations, combinations

from math import pi, sqrt

from collections import deque

from bisect import bisect, bisect_left, bisect_right

from string import ascii_lowercase

from functools import lru_cache

import sys

sys.setrecursionlimit(10000)

INF = float("inf")

YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"

dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]

dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]





def inside(y, x, H, W):

    return 0 <= y < H and 0 <= x < W





def ceil(a, b):

    return (a + b - 1) // b





def main():

    N, M = list(map(int, input().split()))



    s, t = set(), set()

    for _ in range(M):

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

        if a == 1:

            s.add(b)

        if b == 1:

            s.add(a)

        if a == N:

            t.add(b)

        if b == N:

            t.add(a)



    for a in s:

        if a in t:

            print("POSSIBLE")

            return

    print("IMPOSSIBLE")





if __name__ == '__main__':

    main()

from collections import defaultdict
from itertools import product, groupby
from math import pi
from collections import deque
from bisect import bisect, bisect_left, bisect_right

INF = 10**10


def main():
    N, M = list(map(int, input().split()))
    graph = defaultdict(list)
    for _ in range(M):
        a, b = list(map(int, input().split()))
        graph[a].append(b)
        graph[b].append(a)
    for a in graph[1]:
        if N in graph.get(a, []):
            print("POSSIBLE")
            return
    print("IMPOSSIBLE")


if __name__ == "__main__":
    main()

from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys

sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def main():
    N, M = list(map(int, input().split()))
    s, t = set(), set()
    for _ in range(M):
        a, b = list(map(int, input().split()))
        if a == 1:
            s.add(b)
        if b == 1:
            s.add(a)
        if a == N:
            t.add(b)
        if b == N:
            t.add(a)
    for a in s:
        if a in t:
            print("POSSIBLE")
            return
    print("IMPOSSIBLE")


if __name__ == "__main__":
    main()

-from collections import defaultdict -from itertools import product, groupby -from math import pi +from collections import defaultdict, Counter +from itertools import product, groupby, count, permutations, combinations +from math import pi, sqrt +from string import ascii_lowercase +from functools import lru_cache +import sys -INF = 10**10 +sys.setrecursionlimit(10000) +INF = float("inf") +YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no" +dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0] +dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1] + + +def inside(y, x, H, W): +    return 0 <= y < H and 0 <= x < W + + +def ceil(a, b): +    return (a + b - 1) // b -    graph = defaultdict(list) +    s, t = set(), set() -        graph[a].append(b) -        graph[b].append(a) -    for a in graph[1]: -        if N in graph.get(a, []): +        if a == 1: +            s.add(b) +        if b == 1: +            s.add(a) +        if a == N: +            t.add(b) +        if b == N: +            t.add(a) +    for a in s: +        if a in t: