import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, std.bitmanip;

void main() {
    auto N = readln.chomp.to!int;
    auto P = readln.split.map!(to!int).array;
    auto G = new int[][](N);
    auto H = new int[][](N);
    foreach (i; 0..N) G[P[i]-1] ~= i, H[i] ~= P[i]-1;
    auto D = N.iota.map!(i => G[i].length.to!int).array;
    auto A = new int[](N);
    A.fill(-1);

    auto stack = N.iota.filter!(i => D[i] == 0).array;
    while (!stack.empty) {
        auto n = stack.back;
        stack.popBack;
        A[n] = G[n].length.to!int;
        foreach (m; H[n]) {
            D[m] -= 1;
            if (D[m] == 0) stack ~= m;
        }
    }

    foreach (i; 0..N) {
        int[] to_remove;
        foreach (j; 0..G[i].length) if (A[G[i][j]] != -1) to_remove ~= j.to!int;
        foreach_reverse (j; to_remove) G[i].remove(j);
    }

    int n = -1;
    foreach (i; 0..N) if (A[i] == -1) n = i;
    
    if (n == -1) {
        writeln("POSSIBLE");
        return;
    }

    auto mex = G[n].map!(m => A[m]).array;
    mex = mex.filter!(m => m != -1).array;
    mex.sort();
    int p1 = 0;
    while (p1 < mex.length && mex[p1] == p1) ++p1;
    mex ~= p1;
    mex.sort();
    int p2 = 0;
    while (p2 < mex.length && mex[p2] == p2) ++p2;
    
    bool solve(int root, int x) {
        auto B = A.dup;
        auto E = D.dup;
        B[root] = x;
        E[root] = 0;
        int[] stack;
        foreach (m; H[root]) {
            if (E[m] == 0) continue;
            E[m] -= 1;
            if (E[m] == 0) stack ~= m;
        }
        
        while (!stack.empty) {
            auto n = stack.back;
            stack.popBack;
            auto mex = G[n].map!(m => B[m]).array;
            mex = mex.sort().uniq().array;
            int p = 0;
            while (p < mex.length && mex[p] == p) p++;
            B[n] = p;
            foreach (m; H[n]) {
                if (E[m] == 0) continue;
                E[m] -= 1;
                if (E[m] == 0) stack ~= m;
            }
        }

        bool ok = true;
        foreach (i; 0..N) if (B[n] == -1 || G[n].map!(m => B[n] == B[m]).any) ok = false;
        return ok;
    }

    writeln((solve(n, p1) || solve(n, p2)) ? "POSSIBLE" : "IMPOSSIBLE");
}
