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])

def func():
    if ('1' in obj) == True:
        for i in obj['1']:
            if (i in obj) == True:
                for k in obj[i]:
                    if k == n[0]:
                        print('POSSIBLE')
                        return
    print('IMPOSSIBLE')
func()