def inpl(): return input().split()

def get_str(bl): return 'POSSIBLE' if bl else 'IMPOSSIBLE'



n, m = list(map(int, inpl()))

M = list(tuple(map(int, inpl())) for _ in range(m))#[(a, b), ..., (a, b)]

X = list(tuple((a, b)) for a, b in M if a == 1)

Y = list(tuple((a, b)) for a, b in M if b == n)

XB = set(list(b for _, b in X))

YA = set(list(a for a, _ in Y))

print((get_str(len(XB & YA) > 0)))
def main():

    import sys

    input = sys.stdin.readline



    N, M = list(map(int, input().split()))



    g = tuple(set() for _ in range(N))

    for _ in range(M):

        a, b = (int(x) - 1 for x in input().split())

        g[a].add(b)

        g[b].add(a)



    intersect = {u_1 for u_1 in g[0]} & {u_N for u_N in g[N - 1]}

    print(('POSSIBLE' if intersect else 'IMPOSSIBLE'))





if __name__ == '__main__':

    main()

def inpl():
    return input().split()


def get_str(bl):
    return "POSSIBLE" if bl else "IMPOSSIBLE"


n, m = list(map(int, inpl()))
M = list(tuple(map(int, inpl())) for _ in range(m))  # [(a, b), ..., (a, b)]
X = list(tuple((a, b)) for a, b in M if a == 1)
Y = list(tuple((a, b)) for a, b in M if b == n)
XB = set(list(b for _, b in X))
YA = set(list(a for a, _ in Y))
print((get_str(len(XB & YA) > 0)))

def main():
    import sys

    input = sys.stdin.readline
    N, M = list(map(int, input().split()))
    g = tuple(set() for _ in range(N))
    for _ in range(M):
        a, b = (int(x) - 1 for x in input().split())
        g[a].add(b)
        g[b].add(a)
    intersect = {u_1 for u_1 in g[0]} & {u_N for u_N in g[N - 1]}
    print(("POSSIBLE" if intersect else "IMPOSSIBLE"))


if __name__ == "__main__":
    main()

-def inpl(): -    return input().split() +def main(): +    import sys + +    input = sys.stdin.readline +    N, M = list(map(int, input().split())) +    g = tuple(set() for _ in range(N)) +    for _ in range(M): +        a, b = (int(x) - 1 for x in input().split()) +        g[a].add(b) +        g[b].add(a) +    intersect = {u_1 for u_1 in g[0]} & {u_N for u_N in g[N - 1]} +    print(("POSSIBLE" if intersect else "IMPOSSIBLE")) -def get_str(bl): -    return "POSSIBLE" if bl else "IMPOSSIBLE" - - -n, m = list(map(int, inpl())) -M = list(tuple(map(int, inpl())) for _ in range(m))  # [(a, b), ..., (a, b)] -X = list(tuple((a, b)) for a, b in M if a == 1) -Y = list(tuple((a, b)) for a, b in M if b == n) -XB = set(list(b for _, b in X)) -YA = set(list(a for a, _ in Y)) -print((get_str(len(XB & YA) > 0))) +if __name__ == "__main__": +    main()