n = input().split(' ')

array = [[], []]

for i in range(int(n[1])):
    a = input().split(' ')
    if a[0] == '1':
        array[0].append(a[1])
    elif a[1] == n[0]:
        array[1].append(a[0])

print(array)

def func():
    for i in array[0]:
        if i == n[0]:
            print('POSSIBLE')
            return;
        else:
            for t in array[1]:
                if i == t:
                    print('POSSIBLE')
                    return;
    print('IMPOSSIBLE')
func()
