#include<bits/stdc++.h>
#define ll long long
using namespace std;
int n,tot,mx,mn,e[500010],hd[500010],nt[500010],f[500010],v[500010],mp[500010],cnt,fa[500010];
void build(int x,int y){
	tot++;
	e[tot]=y;
	nt[tot]=hd[x];hd[x]=tot;
}
void dfs(int x){
	int i;
	for(i=hd[x];i;i=nt[i]){
		if(mp[e[i]])continue;
		dfs(e[i]);
	}
	for(i=hd[x];i;i=nt[i]){
		if(mp[e[i]])continue;
		v[f[e[i]]]=1;
	}
	while(v[f[x]])f[x]++;
	for(i=hd[x];i;i=nt[i]){
		if(mp[e[i]])continue;
		v[f[e[i]]]=0;
	}
}
int main(){
	int i,x;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		scanf("%d",&fa[i]);
		build(fa[i],i);
	}
	x=1;
	while(!v[x])v[x]=1,x=fa[x];
	while(!mp[x])mp[x]=1,x=fa[x];
	for(i=0;i<=n;i++)v[i]=0;
	mn=n+1;
	for(i=1;i<=n;i++)if(mp[i]){
		dfs(i);
		mx=max(mx,f[i]);
		mn=min(mn,f[i]);cnt++;
	}
	if(mx==mn&&cnt%2==1)puts("IMPOSSIBLE");
	 else puts("POSSIBLE");
}