#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1000000007;

int main() {
    ios::sync_with_stdio(false);
    int n, m, a, b, c[200005] = {}, d[200005] = {};
    cin >> n >> m;
    while (m--) {
        cin >> a >> b;
        if (a == 1) c[b] = 1;
        if (b == n) d[a] = 1;
    }
    for (int i = 1; i <= n; i++) if (c[i] && d[i]) {
        cout << "POSSIBLE";
        return 0;
    }
    cout << "IMPOSSIBLE";
}
