#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <algorithm>
using namespace std;

int n,i,j,k,l,r,u,v,pre,val;
int tmp[200005],T;
int q[200005],p[200005],init[200005];
int col[200005];
vector<int> V[200005];

void fail(){printf("IMPOSSIBLE\n");exit(0);}

int main()
{
	scanf("%d",&n);
	for(i=1;i<=n;++i)scanf("%d",&p[i]),++init[p[i]];
	for(i=1;i<=n;++i)if(!init[i])q[++r]=i;
	for(l=1;l<=r;++l)
	{
		u=q[l];
		++T;
		for(i=0;i<V[u].size();++i)tmp[V[u][i]]=T;
		for(i=0;tmp[i]==T;++i);
		col[u]=i;
		V[p[u]].push_back(i);
		if(!(--init[p[u]]))q[++r]=p[u];
	}
	
	for(i=1;i<=n;++i)if(init[i]){u=i;break;}
	
	++T;
	for(i=0;i<V[u].size();++i)tmp[V[u][i]]=T;
	for(k=0;tmp[k]==T;++k);
	pre=val=k;
	for(i=p[u];i!=u;i=p[i])
	{
		++T;
		tmp[pre]=T;
		for(j=0;j<V[i].size();++j)tmp[V[i][j]]=T;
		for(j=0;tmp[j]==T;++j);
		pre=j;
	}
	if(pre!=val)
	{
		printf("POSSIBLE\n");
		return 0;
	}
	
	++T;
	for(i=0;i<V[u].size();++i)tmp[V[u][i]]=T;
	for(k=0;tmp[k]==T;++k);
	val=k;
	for(++k;tmp[k]==T;++k);
	pre=k;
	for(i=p[u];i!=u;i=p[i])
	{
		++T;
		tmp[pre]=T;
		for(j=0;j<V[i].size();++j)tmp[V[i][j]]=T;
		for(j=0;tmp[j]==T;++j);
		pre=j;
	}
	if(pre==val)printf("POSSIBLE\n");
	else printf("IMPOSSIBLE\n");
}