#include<bits/stdc++.h>
using namespace std;
typedef long long LL;

#define CIN_ONLY if(1)
struct cww{cww(){
    CIN_ONLY{
        ios::sync_with_stdio(false);cin.tie(0);
    }
}}star;
#define fin "\n"
#define FOR(i,bg,ed) for(int i=(bg);i<(ed);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
#define pb push_back
#define DEBUG if(0)
#define REC(ret, ...) std::function<ret (__VA_ARGS__)>
template <typename T>inline bool chmin(T &l,T r)
{bool a=l>r;if(a)l=r;return a;}
template <typename T>inline bool chmax(T &l,T r)
{bool a=l<r;if(a)l=r;return a;}
template <typename T>
istream& operator>>(istream &is,vector<T> &v){
    for(auto &it:v)is>>it;
    return is;
}

typedef vector<int> V;
typedef vector<V> VV;
VV g;
typedef VV Graph;
#define ITR(i,v) for(auto & i :(v))
class SCC{
private:
    Graph e,r_e;
    V vs;
public:
    int size;
    V comp;
    VV node;
    Graph edge;
private:
    void dfs(int v){
        comp[v]=0;
        ITR(u,e[v])if(comp[u]<0)dfs(u);
        vs.pb(v);
    }
    void rdfs(int v,int k){
        comp[v]=k;
        ITR(u,r_e[v])if(comp[u]<0)rdfs(u,k);
    }
    void decomposition(){
        comp.resize(size);
        fill(ALL(comp),-1);
        vs.reserve(size);
        REP(v,size)if(comp[v]<0)dfs(v);
        reverse(ALL(vs));
        fill(ALL(comp),-1);
        int k=0;
        ITR(v,vs)if(comp[v]<0)rdfs(v,k++);
        node.resize(k);
        edge.resize(k);
        REP(v,size){
            node[comp[v]].pb(v);
            for(auto& u : e[v]){
                if(!isSame(v,u)){
                    edge[comp[v]].pb(comp[u]);
                }
            }
        }
        size=k;
    }
public:
    bool isSame(int a,int b){
	return comp[a]==comp[b];
    }
    SCC(Graph& in){
        size=in.size();
        e=in;
        r_e.resize(size);
        REP(v,size)ITR(u,e[v])r_e[u].pb(v);
        decomposition();
    }
};

int gr[212345];
int ngr[212345];
int dfs(int v,V& comp){
    int n=g[v].size()+10;
    vector<int> s(n,0);
    for(auto &u:g[v])if(comp[v]!=comp[u]){
            int latte=dfs(u,comp);
            if(latte>=n)continue;
            s[latte]=1;
        }
    REP(i,n)if(s[i]==0){
        gr[v]=i;
        s[i]=1;
        break;
    }
    REP(i,n)if(s[i]==0){
        ngr[v]=i;
        break;
    }
    //cout<<v<<" "<<gr[v]<<" "<<ngr[v]<<endl;
    return gr[v];

}
void getpath(int v,int ed,V &path,V &comp){
    path.pb(v);
    for(auto &it:g[v])
        if(it!=ed&&comp[v]==comp[it])
            getpath(it,ed,path,comp);
}
int main(){
    int N;
    cin>>N;
    g=VV(N);
    REP(i,N){
        int p;
        cin>>p;
        g[p-1].pb(i);
    }
    SCC scc(g);
    int m=scc.node.size();
    int k=-1;
    REP(i,m)if(scc.node[i].size()>=2)k=i;
    for(auto &v:scc.node[k])dfs(v,scc.comp);
    V path;
    getpath(scc.node[k].front(),scc.node[k].front(),path,scc.comp);
    bool ok=false;
    m=path.size();
    int x=gr[path[m-1]];
    int y=ngr[path[m-1]];
    //cout<<x<<y<<endl;
    FOR(i,1,m){
        int b=path[m-i-1];
        if(x==gr[b])x=ngr[b];
        else x=gr[b];
        if(y==gr[b])y=ngr[b];
        else y=gr[b];
        //cout<<x<<y<<endl;
    }
    if(x!=gr[path[m-1]])ok=true;
    if(y==gr[path[m-1]])ok=true;
    
    if(ok)cout<<"POSSIBLE"<<endl;
    else cout<<"IMPOSSIBLE"<<endl;
    return 0;
}


Measured memory_bytes: 48112