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

L = [[]*n for i in range(n)]

for i in range(m):

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

    L[a-1] += [b]

    L[b-1] += [a]

#print(L)

for i in L[0]:

    if n in L[i-1]:

        print("POSSIBLE")

        exit()

print("IMPOSSIBLE")

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

L = []

for i in range(m):

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

    L.append((a,b))



st,go = set(),set()

for i in range(m):

    if 1 in L[i]:

        st.add(L[i][1])

    if n in L[i]:

        go.add(L[i][0])



if set(st)&set(go):

    print("POSSIBLE")

else:

    print("IMPOSSIBLE")
n, m = list(map(int, input().split()))
L = [[] * n for i in range(n)]
for i in range(m):
    a, b = list(map(int, input().split()))
    L[a - 1] += [b]
    L[b - 1] += [a]
# print(L)
for i in L[0]:
    if n in L[i - 1]:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")

n, m = list(map(int, input().split()))
L = []
for i in range(m):
    a, b = list(map(int, input().split()))
    L.append((a, b))
st, go = set(), set()
for i in range(m):
    if 1 in L[i]:
        st.add(L[i][1])
    if n in L[i]:
        go.add(L[i][0])
if set(st) & set(go):
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

-L = [[] * n for i in range(n)] +L = [] -    L[a - 1] += [b] -    L[b - 1] += [a] -# print(L) -for i in L[0]: -    if n in L[i - 1]: -        print("POSSIBLE") -        exit() -print("IMPOSSIBLE") +    L.append((a, b)) +st, go = set(), set() +for i in range(m): +    if 1 in L[i]: +        st.add(L[i][1]) +    if n in L[i]: +        go.add(L[i][0]) +if set(st) & set(go): +    print("POSSIBLE") +else: +    print("IMPOSSIBLE")