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 G = new int[][](N);
    auto H = new int[][](N);
    auto D = new int[](N);
    foreach (i, p; readln.split.map!(to!int).enumerate) {
        G[p-1] ~= i.to!int;
        H[i] ~= p-1;
        D[p-1] += 1;
    }
    auto A = new int[](N);
    fill(A, -1);

    
    int mex(int n) {
        auto X = G[n].map!(j => A[j]).filter!"a >= 0".array.sort().uniq().array;
        int m = X.length.to!int;
        foreach (i; 0..X.length.to!int) {
            if (i != X[i]) {
                m = i;
                break;
            }
        }
        return m;
    }

    bool check() {
        foreach (i; 0..N) {
            foreach (j; G[i]) 
                if (A[i] == A[j]) 
                    return false;
            if (mex(i) < A[i])
                return false;
        }
        return true;
    }
    
    void dfs(int n) {
        A[n] = mex(n);
        foreach (m; H[n]) {
            D[m] -= 1;
            if (D[m] == 0 && A[i] == -1) {
                dfs(m);
            }
        }
    }


    
    foreach (i; 0..N) {
        if (D[i] == 0 && A[i] == -1) {
            dfs(i);
        }
    }

    if (!A.canFind(-1)) {
        writeln(check ? "POSSIBLE" : "IMPOSSIBLE");
        return;
    }

    foreach (i; 0..N) {
        if (A[i] == - 1) {
            int k = -1;
            foreach (j; H[i]) if (D[j] > 0) k = j;
            int m = mex(i);
            auto AA = A.dup;
            auto DD = D.dup;
            A[i] = m;
            D[i] = 0;
            D[k] = 0;
            dfs(k);
            if (check) {
                writeln("POSSIBLE");
                return;
            }
            A = AA.dup;
            D = DD.dup;
            A[i] = m+1;
            D[i] = 0;
            D[k] = 0;
            dfs(k);
            if (check) {
                writeln("POSSIBLE");
                return;
            }
            break;
        }
    }

    writeln("IMPOSSIBLE");
}

