In Takahashi Kingdom, there is an archipelago of N islands, called Takahashi Islands. For convenience, we will call them Island 1, Island 2, ..., Island N.  There are M kinds of regular boat services between these islands. Each service connects two islands. The i-th service connects Island a_i and Island b_i.  Cat Snuke is on Island 1 now, and wants to go to Island N. However, it turned out that there is no boat service from Island 1 to Island N, so he wants to know whether it is possible to go to Island N by using two boat services.  Help him.

N, M = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(M)]
flag = False
tmp = -1
for i in range(M):
    if ab[i][0] == N:
        tmp = ab[i][1]
        break
    if ab[i][1] == N:
        tmp = ab[i][0]
        break

for j in range(M):
    if ab[j][0] == tmp and ab[i][1] == 1:
        flag = True
        break
    if ab[j][1] == tmp and ab[i][0] == 1:
        flag = True
        break
if flag:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
from collections import deque
N, M = map(int, input().split())
lst = [[] for _ in range(N + 1)]
dist = [float("inf")]*(N+1)
dist[1] = 0
for _ in range(M):
    a, b = map(int, input().split())
    lst[a].append(b)
    lst[b].append(a)

q = deque()
q.append(1)

while q:
    now = q.popleft()

    for itm in lst[now]:
        if dist[itm] > dist[now]:
            q.append(itm)
            dist[itm] = dist[now] + 1
print("POSSIBLE") if dist[N] <= 2 else print("IMPOSSIBLE")