Buggy python submission (verdict: Runtime Error):
from collections import deque
n, m = map(int, input().split())
dat = deque([])
dat_finish = [False] * (n + 1)

for i in range(m):
    a, b = map(int, input().split())
    dat.append((a, b))

dat2 = dat.copy()

for i in range(m):
    a, b = dat.pop()
    if b == n:
        dat_finish[a] = True

c = False
for i in range(m):
    a, b = dat2.pop()
    if a == 1:
        if dat_finish[b]:
            c = True

print("POSSIBLE" if c else "IMPOSSIBLE")

Fixed submission:
n, m = map(int, input().split())
dat = []
dat_m = [[]] * (n+1)
dat_finish = [False] * (n+1)

for i in range(m):
    a,b = map(int, input().split())
    dat.append( (a,b) )

#print(dat)
for i in range(m):
    a,b = dat[i]
    if b == n:
        dat_finish[a] = True
#print(dat_finish)

c = False
for i in range(m):
    a,b = dat[i]
    if a == 1:
        if dat_finish[b]:
            c = True

print("POSSIBLE" if c else "IMPOSSIBLE")

Buggy python submission (verdict: Runtime Error):
    from collections import deque
    n, m = map(int, input().split())
    dat_m = [deque([]) for x in range(n + 1)]

    for i in range(m):
        a, b = map(int, input().split())
        dat_m[a].append(b)

    c = False
    for i in dat_m[1]:
        if n in dat_m[i]:
            c = True

    print("POSSIBLE" if c else "IMPOSSIBLE")

Fixed submission:
n, m = map(int, input().split())
dat = []
dat_m = [[]] * (n+1)
dat_finish = [False] * (n+1)

for i in range(m):
    a,b = map(int, input().split())
    dat.append( (a,b) )

#print(dat)
for i in range(m):
    a,b = dat[i]
    if b == n:
        dat_finish[a] = True
#print(dat_finish)

c = False
for i in range(m):
    a,b = dat[i]
    if a == 1:
        if dat_finish[b]:
            c = True

print("POSSIBLE" if c else "IMPOSSIBLE")

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
dat_m = [[]] * (n+1)
dat_finish = [False] * (n+1)


for i in range(m):
    a,b = map(int, input().split())
    dat_m[a] = dat_m[a] + [b]
    if b == n:
        dat_finish[a] = True
#print(dat_m)
#print(dat_finish)

c = False
for i in dat_m[1]:
    if dat_finish[i]:
        c = True
print("POSSIBLE" if c else "IMPOSSIBLE")

Fixed submission:
n, m = map(int, input().split())
dat = []
dat_m = [[]] * (n+1)
dat_finish = [False] * (n+1)

for i in range(m):
    a,b = map(int, input().split())
    dat.append( (a,b) )

#print(dat)
for i in range(m):
    a,b = dat[i]
    if b == n:
        dat_finish[a] = True
#print(dat_finish)

c = False
for i in range(m):
    a,b = dat[i]
    if a == 1:
        if dat_finish[b]:
            c = True

print("POSSIBLE" if c else "IMPOSSIBLE")

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
dat_m = [[]] * (n+1)
for i in range(m):
    a,b = map(int, input().split())
    dat_m[a] = dat_m[a] + [b]
# print(dat_m)

c = False
for i in dat_m[1]:
    if n in dat_m[i]:
        c = True
print("POSSIBLE" if c else "IMPOSSIBLE")


Fixed submission:
n, m = map(int, input().split())
dat = []
dat_m = [[]] * (n+1)
dat_finish = [False] * (n+1)

for i in range(m):
    a,b = map(int, input().split())
    dat.append( (a,b) )

#print(dat)
for i in range(m):
    a,b = dat[i]
    if b == n:
        dat_finish[a] = True
#print(dat_finish)

c = False
for i in range(m):
    a,b = dat[i]
    if a == 1:
        if dat_finish[b]:
            c = True

print("POSSIBLE" if c else "IMPOSSIBLE")

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
dat_m = [[]] * (n+1)
for i in range(m):
    a,b = map(int, input().split())
    dat_m[a] = dat_m[a] + [b]
# print(dat_m)

c = False
for i in dat_m[1]:
    if n in dat_m[i]:
        c = True
print("POSSIBLE" if c else "IMPOSSIBLE")


Fixed submission:
n, m = map(int, input().split())
dat = []
dat_m = [[]] * (n+1)
dat_finish = [False] * (n+1)

for i in range(m):
    a,b = map(int, input().split())
    dat.append( (a,b) )

#print(dat)
for i in range(m):
    a,b = dat[i]
    if b == n:
        dat_finish[a] = True
#print(dat_finish)

c = False
for i in range(m):
    a,b = dat[i]
    if a == 1:
        if dat_finish[b]:
            c = True

print("POSSIBLE" if c else "IMPOSSIBLE")