Buggy python submission (verdict: Runtime Error):
N, M = list(map(int, input().split()))
X = [0] * N
Y = [0] * N
for i in range(M):
    S, E = list(map(int, input().split()))
    if S == 1:
        X[E-1] = 1
    if E == N:
        Y[S-1] = 1
for i in range(N):
    if X[i] = Y[i]:
        print("POSSIBLE")
        break
else:
    print("IMPOSSIBLE")


Fixed submission:
N, M = list(map(int, input().split()))
X = [0] * N
Y = [0] * N
for i in range(M):
    S, E = list(map(int, input().split()))
    if S == 1:
        X[E-1] = 1
    if E == N:
        Y[S-1] = 1
for i in range(N):
    if X[i] == 1 and Y[i] == 1:
        print("POSSIBLE")
        break
else:
    print("IMPOSSIBLE")

Buggy python submission (verdict: Time Limit Exceeded):
N, M = list(map(int, input().split()))
X = []
Y = []
for i in range(M):
    S, E = list(map(int, input().split()))
    if S == 1:
        X.append(E)
    if E == N:
        Y.append(S)
while 1:
    if X == [] or Y == []:
        print("IMPOSSIBLE")
        break
    min_x = min(X)
    min_y = min(Y)
    if min_x == min_y:
        print("POSSIBLE")
        break
    elif min_x > min_y:
        Y.remove(min_y)
    elif min_x < min_y:
        X.remove(min_x)
else:
    print("IMPOSSIBLE")


Fixed submission:
N, M = list(map(int, input().split()))
X = [0] * N
Y = [0] * N
for i in range(M):
    S, E = list(map(int, input().split()))
    if S == 1:
        X[E-1] = 1
    if E == N:
        Y[S-1] = 1
for i in range(N):
    if X[i] == 1 and Y[i] == 1:
        print("POSSIBLE")
        break
else:
    print("IMPOSSIBLE")

Buggy python submission (verdict: Time Limit Exceeded):
N, M = list(map(int, input().split()))
S = [0] * M
E = [0] * M
for i in range(M):
    S[i], E[i] = list(map(int, input().split()))
X = []
Y = []
for i in range(M):
    if S[i] == 1:
        X.append(E[i])
    if E[i] == N:
        Y.append(S[i])
while 1:
    if X == [] or Y == []:
        print("IMPOSSIBLE")
        break
    min_x = min(X)
    min_y = min(Y)
    if min_x == min_y:
        print("POSSIBLE")
        break
    elif min_x > min_y:
        Y.remove(min_y)
    elif min_x < min_y:
        X.remove(min_x)
else:
    print("IMPOSSIBLE")


Fixed submission:
N, M = list(map(int, input().split()))
X = [0] * N
Y = [0] * N
for i in range(M):
    S, E = list(map(int, input().split()))
    if S == 1:
        X[E-1] = 1
    if E == N:
        Y[S-1] = 1
for i in range(N):
    if X[i] == 1 and Y[i] == 1:
        print("POSSIBLE")
        break
else:
    print("IMPOSSIBLE")

Buggy python submission (verdict: Time Limit Exceeded):
N, M = list(map(int, input().split()))
S = [0] * M
E = [0] * M
for i in range(M):
    S[i], E[i] = list(map(int, input().split()))
X = []
Y = []
for i in range(M):
    if S[i] == 1:
        X.append(E[i])
    if E[i] == N:
        Y.append(S[i])
for i in range(len(X)):
    for j in range(len(Y)):
        if X[i] == Y[j]:
            print("POSSIBLE")
            break
    else:
        continue
    break
else:
    print("IMPOSSIBLE")


Fixed submission:
N, M = list(map(int, input().split()))
X = [0] * N
Y = [0] * N
for i in range(M):
    S, E = list(map(int, input().split()))
    if S == 1:
        X[E-1] = 1
    if E == N:
        Y[S-1] = 1
for i in range(N):
    if X[i] == 1 and Y[i] == 1:
        print("POSSIBLE")
        break
else:
    print("IMPOSSIBLE")