Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
c = [[] for _ in range(m+1)]
for i in range(m):
  a, b = map(int, input().split())
  c[a].append(b)
  c[b].append(a)

for i in c[1]:
  if n in c[i]:
    print('POSSIBLE')
    exit()

print('IMPOSSIBLE')

Fixed submission:
n, m = map(int, input().split())
c = [[] for _ in range(n+1)]
for i in range(m):
  a, b = map(int, input().split())
  c[a].append(b)
  c[b].append(a)

for i in c[1]:
  if n in c[i]:
    print('POSSIBLE')
    exit()

print('IMPOSSIBLE')

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
l = list(list(map(int, input().split())) for _ in range(m))
c = []
for i in l:
  if i[0] == n:
    c.append(i[1])
    l.remove(i)
  elif i[1] == n:
    c.append(i[0])
    l.remove(i)
  elif 1 in i:
    continue
  else:
    l.remove(i)
    
for i in range(len(l)):
  if l[i][0] == 1:
    if l[i][1] in c:
      print('POSSIBLE')
      exit()
  if l[i][1] == 1:
    if l[i][0] in c:
      print('POSSIBLE')
      exit()
print('IMPOSSIBLE')

Fixed submission:
n, m = map(int, input().split())
c = [[] for _ in range(n+1)]
for i in range(m):
  a, b = map(int, input().split())
  c[a].append(b)
  c[b].append(a)

for i in c[1]:
  if n in c[i]:
    print('POSSIBLE')
    exit()

print('IMPOSSIBLE')

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
l = list(list(map(int, input().split())) for _ in range(m))
c = []
for i in range(m):
  if l[i][0] == n:
    c.append(l[i][1])
  elif l[i][1] == n:
    c.append(l[i][0])

for i in range(m):
  if l[i][0] == 1:
    if l[i][1] in c:
      print('POSSIBLE')
      exit()
  if l[i][1] == 1:
    if l[i][0] in c:
      print('POSSIBLE')
      exit()
print('IMPOSSIBLE')

Fixed submission:
n, m = map(int, input().split())
c = [[] for _ in range(n+1)]
for i in range(m):
  a, b = map(int, input().split())
  c[a].append(b)
  c[b].append(a)

for i in c[1]:
  if n in c[i]:
    print('POSSIBLE')
    exit()

print('IMPOSSIBLE')

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
l = list(list(map(int, input().split())) for _ in range(m))
c = []
for i in range(m):
  if l[i][0] == n:
    c.append(l[i][1])
  elif l[i][1] == n:
    c.append(l[i][0])

for i in l:
  for j in c:
    if i == [1, j] or i == [j, 1]:
      d = 1
      print('POSSIBLE')
      exit()
print('IMPOSSIBLE')

Fixed submission:
n, m = map(int, input().split())
c = [[] for _ in range(n+1)]
for i in range(m):
  a, b = map(int, input().split())
  c[a].append(b)
  c[b].append(a)

for i in c[1]:
  if n in c[i]:
    print('POSSIBLE')
    exit()

print('IMPOSSIBLE')

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
l = list(list(map(int, input().split())) for _ in range(m))
c = []
for i in range(m):
  if l[i][0] == n:
    c.append(l[i][1])
  elif l[i][1] == n:
    c.append(l[i][0])
d = 0
for i in l:
  for j in c:
    if i == [1, j] or i == [j, 1]:
      d = 1
print('POSSIBLE' if d == 1 else 'IMPOSSIBLE')

Fixed submission:
n, m = map(int, input().split())
c = [[] for _ in range(n+1)]
for i in range(m):
  a, b = map(int, input().split())
  c[a].append(b)
  c[b].append(a)

for i in c[1]:
  if n in c[i]:
    print('POSSIBLE')
    exit()

print('IMPOSSIBLE')