#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

int clr[200105], p[200105];
int cycle[200105], found;
int n, x;
vector<int> g[200105], vc;
int grundy[200105], grundy2[200105];

void dfs_cycle(int v, int pr = -1) {
    if (clr[v] == 2 || found)
        return;
    p[v] = pr;
    if (clr[v] == 1) {
        int cur = v;
        do
            vc.push_back(cur), cur = p[cur];
        while (cur != v);
        found = true;
        return;
    }
    clr[v] = 1;
    for (int to : g[v])
        dfs_cycle(to, v);
    clr[v] = 2;
}

int dfs_grundy(int v) {
    if (grundy[v] == -1) {
        vector<int> vec;
        for (int to : g[v]) {
            if (to != cycle[v])
                vec.push_back(dfs_grundy(to));
        }
        sort(vec.begin(), vec.end());
        vec.resize(unique(vec.begin(), vec.end()) - vec.begin());
        int f = -1, f2 = -1;
        if (vec.size() == 0) {
            f = 0;
            f2 = 1;
        } else {
            if (vec[0] > 0) {
                f = 0;
                if (vec[0] > 1) {
                    f2 = 1;
                }
            }
            for (int i = 0; i + 1 < vec.size(); ++i) {
                if (vec[i] + 2 < vec[i + 1]) {
                    if (f == -1)
                        f = vec[i] + 1, f2 = vec[i] + 2;
                    else if (f2 == -1)
                        f2 = vec[i] + 1;
                } else if (vec[i] + 1 < vec[i + 1]) {
                    if (f == -1)
                        f = vec[i] + 1;
                    else if (f2 == -1)
                        f2 = vec[i] + 1;
                }
            }
            if (f == -1)
                f = vec.back() + 1, f2 = f + 1;
            else if (f2 == -1)
                f2 = vec.back() + 1;
        }
        grundy[v] = f;
        grundy2[v] = f2;
    }
    return grundy[v];
}

int main()
{
    ios_base::sync_with_stdio(false);

    cin >> n;
    for (int i = 1; i <= n; ++i) {
        cin >> x;
        g[x].push_back(i);
    }
    for (int i = 1; i <= n && !found; ++i) {
        if (clr[i] == 0)
            dfs_cycle(i);
    }

    for (int i = 0; i < vc.size(); ++i)
        cycle[vc[i]] = vc[(i + vc.size() - 1) % vc.size()];

    for (int i = 1; i <= n; ++i)
        grundy[i] = -1;
    for (int i = 1; i <= n; ++i)
        dfs_grundy(i);

    for (int i = 1; i <= n; ++i) {
        if (cycle[i]) {
            int cur = i;
            int curgr = grundy[i];
            do {
                int nxt = p[cur];
                int nxtgr = grundy[nxt];
                if (nxtgr == curgr)
                    nxtgr = grundy2[nxt];
                cur = nxt;
                curgr = nxtgr;
            } while (cur != i);
            if (curgr == grundy[i]) {
                puts("POSSIBLE");
                exit(0);
            }

            cur = i;
            curgr = grundy2[i];
            do {
                int nxt = p[cur];
                int nxtgr = grundy[nxt];
                if (nxtgr == curgr)
                    nxtgr = grundy2[nxt];
                cur = nxt;
                curgr = nxtgr;
            } while (cur != i);
            if (curgr == grundy2[i]) {
                puts("POSSIBLE");
                exit(0);
            }

            break;
        }
    }

    puts("IMPOSSIBLE");

    return 0;
}


Measured memory_bytes: 25332