#include <bits/stdc++.h>
                            #include<iostream>
                            #include<cstdio>
                            #include<vector>
                            #include<queue>
                            #include<map>
                            #include<cstring>
                            #include<string>
                            #include <math.h>
                            #include<algorithm>
                        //    #include <boost/multiprecision/cpp_int.hpp>
                            #include<functional>
                     #define int long long
                            #define inf  1000000007
                            #define pa pair<int,int>
                            #define ll long long
                            #define pal pair<double,int>
                            #define ppa pair<string,pa>
                            #define ssa pair<string,int>
                            #define  mp make_pair
                            #define  pb push_back
                            #define EPS (1e-10)
                            #define equals(a,b) (fabs((a)-(b))<EPS)
                     
                            using namespace std;
                     //priority_queue<int, vector<int>, greater<int> > que;
                            class Point{
                            	public:
                            	double x,y;
                            	Point(double x=0,double y=0):x(x),y(y) {}
                            	Point operator + (Point p) {return Point(x+p.x,y+p.y);}
                            	Point operator - (Point p) {return Point(x-p.x,y-p.y);}
                            	Point operator * (double a) {return Point(x*a,y*a);}
                            	Point operator / (double a) {return Point(x/a,y/a);}
                            	double absv() {return sqrt(norm());}
                            	double norm() {return x*x+y*y;}
                            	bool operator < (const Point &p) const{
                            		return x != p.x ? x<p.x: y<p.y;
                            	}
                            	bool operator == (const Point &p) const{
                            		return fabs(x-p.x)<EPS && fabs(y-p.y)<EPS;
                            	}
                            };
                            typedef Point Vector;
                     
                            struct Segment{
                            Point p1,p2;
                            };
                     
                        double hen(Vector a){
                        if(fabs(a.x)<EPS && a.y>0) return acos(0);
                        else if(fabs(a.x)<EPS && a.y<0) return 3*acos(0);
                        else if(fabs(a.y)<EPS && a.x<0) return 2*acos(0);
                        else if(fabs(a.y)<EPS && a.x>0) return 0.0;
                        else if(a.y>0) return acos(a.x/a.absv());
                        else return 2*acos(0)+acos(-a.x/a.absv());
                     
                        }
                     
                string itos( int i ) {
                ostringstream s ;
                s << i ;
                return s.str() ;
                }
                 
                int gcd(int v,int b){
                	if(v>b) return gcd(b,v);
                	if(v==b) return b;
                	if(b%v==0) return v;
                	return gcd(v,b%v);
                }
                            double dot(Vector a,Vector b){
                            	return a.x*b.x+a.y*b.y;
                            }
                            double cross(Vector a,Vector b){
                            	return a.x*b.y-a.y*b.x;
                            }
                        
                double distans(double x1,double y1,double x2,double y2){
                	double rr=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
                	return sqrt(rr);
                	
                }


                         //----------------kokomade tenpure------------

int a[200020];
int n;
int loop[200020];
int ky[200020]={0};
vector<int> G[200020];
vector<int> G2[400020];
int nxloop[200020];
int mem[200020]={0};
int po[200020][2];
bool tou[400020]={0};

int cul(int e,int ch){
	if(ch==0){
	vector<int> ve;
	for(int i=0;i<G[e].size();i++){
	//	if(G[e][i]==nxloop[e]) continue;
		ve.pb(cul(G[e][i],0));
	}
		int ma=0;
		for(int i=0;i<ve.size();i++){
			mem[ve[i]]=1;
			ma=max(ma,ve[i]);
		}
		int ans=1000000000000;
		for(int i=0;i<=ma+4;i++){
			if(mem[i]==1) mem[i]=0;
			else ans=min(ans,i);
		}
		return ans;
	}
	else{
			vector<int> ve;
	for(int i=0;i<G[e].size();i++){
		if(G[e][i]==nxloop[e]) continue;
		ve.pb(cul(G[e][i],0));
	}
		int ma=0;
		for(int i=0;i<ve.size();i++){
			mem[ve[i]]=1;
			ma=max(ma,ve[i]);
		}
		int ans=1000000000000;
		int ans2=1000000000000;
		for(int i=0;i<=ma+10;i++){
			if(mem[i]!=0) mem[i]=0;
			else if(ans>100000000) {
				ans=min(ans,i);
			}
			else ans2=min(ans2,i);
		}
		po[e][0]=ans;
		po[e][1]=ans2;
	//	cout<<e<<" "<<po[e][0]<<" "<<po[e][1]<<endl;
		return 0;
		
	
		
		
		
		
		
	}

}

void dfs(int r){
	if(tou[r]==1) return;
	tou[r]=1;
	for(int i=0;i<G2[r].size();i++)dfs(G2[r][i]);
	
}


signed main(){
cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		G[a[i]].pb(i);
		ky[i]=-1;
	}
	int st=1,di=0;
	while(1){
		if(ky[st]!=-1) break;
		ky[st]=di;
		st=a[st];
		di++;
		
	}
	int nagasa=di-ky[st];
	int lo=st;
	for(int i=0;i<nagasa+1;i++){
		loop[i]=lo;
		//cout<<lo<<endl;
		lo=a[lo];
		
	}
	for(int i=1;i<=nagasa;i++) nxloop[loop[i]]=loop[i-1];
	for(int i=0;i<nagasa;i++)cul(loop[i],1);
	
	for(int i=nagasa-1;i>0;i--){
		if(po[loop[i]][0]!=po[loop[i-1]][0])G2[2*loop[i]].pb(2*loop[i-1]);
		if(po[loop[i]][0]!=po[loop[i-1]][1])G2[2*loop[i]].pb(2*loop[i-1]+1);
		if(po[loop[i]][0]==po[loop[i-1]][0])G2[2*loop[i]+1].pb(2*loop[i-1]);
		if(po[loop[i]][0]==po[loop[i-1]][1])G2[2*loop[i]+1].pb(2*loop[i-1]+1);
	//	cout<<loop[i]<<" "<<loop[i-1]<<endl;
	}
	/*
	for(int i=0;i<8;i++){
		cout<<i<<" ";
		for(int j=0;j<G2[i].size();j++) cout<<G2[i][j]<<" ";
		cout<<endl;
	}
	*/
	int re[2][2]={0};
	for(int i=nagasa;i>=nagasa;i--){
		if(po[loop[i]][0]!=po[loop[i-1]][0])re[0][0]=1;
		if(po[loop[i]][0]!=po[loop[i-1]][1])re[0][1]=1;
		if(po[loop[i]][0]==po[loop[i-1]][0])re[1][0]=1;
		if(po[loop[i]][0]==po[loop[i-1]][1])re[1][1]=1;
		//cout<<loop[i]<<" "<<loop[i-1]<<endl;
	}
	bool b=false;
	
	dfs(loop[nagasa-1]*2);
	
	
	
	if(tou[loop[0]*2]==1&& re[0][0]==1){
		b=true;
	}
	if(tou[loop[0]*2+1]==1 && re[1][0]==1){
		b=true;
	}
	
	for(int i=0;i<400040;i++) tou[i]=0;
	dfs(loop[nagasa-1]*2+1);
	if(tou[loop[0]*2]==1&& re[0][1]==1){
		b=true;
	}
	if(tou[loop[0]*2+1]==1 && re[1][1]==1){
		b=true;
	}
	
	if(b) cout<<"POSSIBLE"<<endl;
	else cout<<"IMPOSSIBLE"<<endl;
	
//	cout<<ans<<endl;
	
	return 0;
}

Measured memory_bytes: 45824