n = input().split(' ')

obj = {}

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


if ('1' in obj) == True and (n[1] in obj) == True:
    check = False
    for i in obj['1']:
        if (i in obj) == True:
            for k in obj[i]:
                if k == n[0]:
                    print('POSSIBLE')
                    check = True
                    break
        if check == True:
            break
    if check == False:
        print('IMPOSSIBLE')
else:
    print('IMPOSSIBLE')
