#include<bits/stdc++.h>
using namespace std;
#define N 1111116

int n,t,p[N],h[N],a[N];
vector<int> q,v[N],f;

void travel(int x){
	for (int i=0;i<(int)v[x].size();i++)
		if (!h[v[x][i]]) travel(v[x][i]);
	f.clear();
	for (int i=0;i<(int)v[x].size();i++)
		if (!h[v[x][i]]) f.push_back(a[v[x][i]]);
	f.push_back(-1);f.push_back(1e9);a[x]=-1;
	sort(f.begin(),f.end());
	for (int i=0;a[x]==f[i];)
		for (a[x]++;a[x]==f[i+1];) i++;
}

int read(){
	int x=0,f=1;char ch=getchar();
	for (;!isdigit(ch);ch=getchar()) if (ch=='-')  f=-f;
	for (;isdigit(ch);ch=getchar()) x=x*10+ch-'0';
	return x*f;
}

int main(){
	n=read();
	for (int i=1;i<=n;i++) p[i]=read();
	for (int i=1;i<=n;i++) v[p[i]].push_back(i);
	for (int i=t=1;i<=n;i++) t=p[t];
	for (;!h[t];t=p[t]) h[t]=1,q.push_back(t);
	for (int i=0;i<(int)q.size();i++) travel(q[i]);
	for (int i=1;i<(int)q.size();i++)
		if (a[q[i]]!=a[q[i-1]]) {printf("POSSIBLE\n");return 0;}
	printf(q.size()%2?"IMPOSSIBLE\n":"POSSIBLE\n");
	return 0;
}