#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <sstream>
#include <string>
#define _repargs(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _repargs(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define inf 2000000007
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;
template <typename T>
inline void output(T a, int p = 0) {
    if(p) cout << fixed << setprecision(p)  << a << "\n";
    else cout << a << "\n";
}
// end of template
vector<vector<int>> G;

class scc_decomposition{
public:
    int V;
    vector<vector<int>> E, rE;
    vector<int> pos, used, cmp;
    scc_decomposition() {}
    scc_decomposition(int v){
        V = v;
        E.resize(v);
        rE.resize(v);
        cmp.resize(v);
        used.resize(v, 0);
    }
    
    void add(int from, int to){
        E[from].push_back(to);
        rE[to].push_back(from);
    }
    
    void dfs(int v){
        used[v] = 1;
        rep(i, E[v].size()){
            if (!used[E[v][i]]) dfs(E[v][i]);
        }
        pos.push_back(v);
    }
    
    void rdfs(int v, int k){
        used[v] = 1;
        cmp[v] = k;
        rep(i, rE[v].size()){
            if (!used[rE[v][i]]) rdfs(rE[v][i], k);
        }
    }
    
    int scc(){
        rep(v, V){
            if (!used[v]) dfs(v);
        }
        used.assign(V, 0);
        int k = 0;
        for (int i = (int)pos.size() - 1; i >= 0; i--) {
            if (!used[pos[i]]) rdfs(pos[i], k++);
        }
        return k; // return the number of sccs
    }
};

template <typename T> inline void voutput(T &v){
    rep(i, v.size()){
        if (i) cout << " " << v[i];
        else cout << v[i];
    }
    cout << endl;
}

vector<int> grd;
scc_decomposition scc;

int dfs(int cur, int par = -1){
    vector<int> tmp;
    for(int a: scc.E[cur]){
        
        if(scc.cmp[a] != scc.cmp[cur]){
            tmp.pb(dfs(a));
        }
    }
    sort(all(tmp));
    rep(i, tmp.size()){
        if(tmp[i] != i){
            return i;
        }
    }
    return (int)tmp.size();
}

bool same(vector<int> &V){
    int a = V[0];
    rep(i, V.size()){
        if(a != V[i]) return false;
    }
    return true;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    // source code
    int N;
    cin >> N;
//    G.resize(N);
//    
//    rep(i, N){
//        int p;
//        cin >> p;
//        G[p - 1].pb(i);
//    }
    
    scc = scc_decomposition(N);
    rep(i, N){
        int p;
        cin >> p;
        scc.add(p - 1, i);
    }
    scc.scc();
    
//    voutput(scc.cmp);
    
    vector<vector<int>> A(N);
    rep(i, N){
        A[scc.cmp[i]].pb(i);
    }
    
    vector<int> B;
    rep(i, N){
        if(A[i].size() >= 2) B = A[i];
    }
//    voutput(B);
    
    grd.resize(B.size());
    
    rep(i, B.size()){
        grd[i] = dfs(B[i]);
    }
    
//    voutput(grd);
    if(same(grd) && grd.size() % 2 == 1){
        output("IMPOSSIBLE");
    }
    else{
        output("POSSIBLE");
    }
    
    
    
    return 0;
}

Measured memory_bytes: 34168