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

matrix = [[] for i in range(N)]

check1 = [0] * N

check1[0] = 1



for i in range(M):

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

    a, b = a-1, b-1

    matrix[a].append(b)

    matrix[b].append(a)



for i in matrix[0]:

    if (N-1) in matrix[i]:

        print('POSSIBLE')

        break

else:

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

check = [0] * N

check[0] = 1

ab = []

for i in range(M):

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

    ab.append([a, b])

    if a == 1:

        check[b-1] = 1



for a, b in ab:

    if check[a-1] == 1 and b == N:

        print('POSSIBLE')

        break

else:

    print('IMPOSSIBLE')

N, M = list(map(int, input().split()))
matrix = [[] for i in range(N)]
check1 = [0] * N
check1[0] = 1
for i in range(M):
    a, b = list(map(int, input().split()))
    a, b = a - 1, b - 1
    matrix[a].append(b)
    matrix[b].append(a)
for i in matrix[0]:
    if (N - 1) in matrix[i]:
        print("POSSIBLE")
        break
else:
    print("IMPOSSIBLE")

N, M = list(map(int, input().split()))
check = [0] * N
check[0] = 1
ab = []
for i in range(M):
    a, b = list(map(int, input().split()))
    ab.append([a, b])
    if a == 1:
        check[b - 1] = 1
for a, b in ab:
    if check[a - 1] == 1 and b == N:
        print("POSSIBLE")
        break
else:
    print("IMPOSSIBLE")

-matrix = [[] for i in range(N)] -check1 = [0] * N -check1[0] = 1 +check = [0] * N +check[0] = 1 +ab = [] -    a, b = a - 1, b - 1 -    matrix[a].append(b) -    matrix[b].append(a) -for i in matrix[0]: -    if (N - 1) in matrix[i]: +    ab.append([a, b]) +    if a == 1: +        check[b - 1] = 1 +for a, b in ab: +    if check[a - 1] == 1 and b == N: