Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
#ABC68 C

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

ab = [list(map(int,input().split())) for _ in range(m)]
s = [ab[i][1] for i in range(m) if ab[i][0] == 1]
g = [ab[i][0] for i in range(m) if ab[i][1] == n]
f = 0
s.sort()
s.reverse()
g.sort()
for i in s:
    if i in g:
        f = 1
        break
if f:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')


Fixed submission:
#!/usr/bin/env python3
#ABC68 C

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

s = [0]*(200000+1)
g = [0]*(200000+1)
for _ in range(m):
    a,b = map(int,input().split())
    if a == 1:
        s[b] += 1
    if b == n:
        g[a] += 1
f = 0
for i in range(200000+1):
    if s[i] & g[i]:
        f = 1
        break
if f:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
#ABC68 C

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

ab = [list(map(int,input().split())) for _ in range(m)]
s = [ab[i][1] for i in range(m) if ab[i][0] == 1]
g = [ab[i][0] for i in range(m) if ab[i][1] == n]
f = 0
for i in s:
    if i in g:
        f = 1
        break
if f:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')


Fixed submission:
#!/usr/bin/env python3
#ABC68 C

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

s = [0]*(200000+1)
g = [0]*(200000+1)
for _ in range(m):
    a,b = map(int,input().split())
    if a == 1:
        s[b] += 1
    if b == n:
        g[a] += 1
f = 0
for i in range(200000+1):
    if s[i] & g[i]:
        f = 1
        break
if f:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
#ABC68 C

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

s = []
g = []
for _ in range(m):
    a,b = map(int,input().split())
    if a == 1:
        s.append(b)
    if b == n:
        g.append(a)
f = 0
s = list(set(s))
g = list(set(g))
for i in range(len(s)):
    if s[i] in g:
        f = 1
if f:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')


Fixed submission:
#!/usr/bin/env python3
#ABC68 C

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

s = [0]*(200000+1)
g = [0]*(200000+1)
for _ in range(m):
    a,b = map(int,input().split())
    if a == 1:
        s[b] += 1
    if b == n:
        g[a] += 1
f = 0
for i in range(200000+1):
    if s[i] & g[i]:
        f = 1
        break
if f:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
#ABC68 C

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

s = []
g = []
for _ in range(m):
    a,b = map(int,input().split())
    if a == 1:
        s.append(b)
    if b == n:
        g.append(a)
f = 0
for i in range(len(s)):
    if s[i] in g:
        f = 1
if f:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')


Fixed submission:
#!/usr/bin/env python3
#ABC68 C

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

s = [0]*(200000+1)
g = [0]*(200000+1)
for _ in range(m):
    a,b = map(int,input().split())
    if a == 1:
        s[b] += 1
    if b == n:
        g[a] += 1
f = 0
for i in range(200000+1):
    if s[i] & g[i]:
        f = 1
        break
if f:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
#ABC68 C

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

s = []
g = []
for _ in range(m):
    a,b = map(int,input().split())
    if a == 1:
        s.append(b)
    if b == n:
        g.append(a)
f = 0
for i in range(len(s)):
    if s[i] in g:
        f = 1
if f:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')


Fixed submission:
#!/usr/bin/env python3
#ABC68 C

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

s = [0]*(200000+1)
g = [0]*(200000+1)
for _ in range(m):
    a,b = map(int,input().split())
    if a == 1:
        s[b] += 1
    if b == n:
        g[a] += 1
f = 0
for i in range(200000+1):
    if s[i] & g[i]:
        f = 1
        break
if f:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')