#include<bits/stdc++.h>
using namespace std;
inline int read(){
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+ch-'0';ch=getchar();}
	return x*f;
}
#define MN 200005
int n,last[MN],cir[MN],mem,now,sg[MN],sg2[MN],f[MN],vis[MN];
bool found,inq[MN],cime[MN],Vis[MN];
struct edge{int to,nex;}e[MN];int cnt,hr[MN];
inline void ins(int f,int t){
	e[++cnt]=(edge){t,hr[f]};hr[f]=cnt;
}
void findcircle(int x){
	if(found) return;inq[x]=Vis[x]=true;
	for(int i=hr[x];i;i=e[i].nex){
		if(inq[e[i].to]){for(int j=x;j!=e[i].to;j=last[j]) cir[++mem]=j;cir[++mem]=e[i].to;found=true;}
		else if(!Vis[e[i].to]) last[e[i].to]=x,findcircle(e[i].to);
	}
	inq[x]=false;
}
void dp(int x){
	register int i;
	for(i=hr[x];i;i=e[i].nex) if(!cime[e[i].to]) dp(e[i].to);
	++now;for(i=hr[x];i;i=e[i].nex) if(!cime[e[i].to]) vis[sg[e[i].to]]=now;
	for(;vis[sg[x]]==now;sg[x]++);
	for(sg2[x]=sg[x]+1;vis[sg2[x]]==now;sg2[x]++);
}
bool check(){
	f[1]=sg[cir[1]];register int i;
    for(i=2;i<=mem;i++) f[i]=f[i-1]==sg[cir[i]]?sg2[cir[i]]:sg[cir[i]];
    if(f[mem]!=sg[cir[1]]) return true;
    f[1]=sg2[cir[1]];
    for(i=2;i<=mem;i++) f[i]=f[i-1]==sg[cir[i]]?sg2[cir[i]]:sg[cir[i]];
    if(f[mem]==sg[cir[1]]) return true;
    return false;
}
int main(){
	n=read();register int i;
	for(i=1;i<=n;i++) ins(read(),i);
	for(i=1;i<=n;i++) findcircle(i);
	for(i=1;i<=mem;i++) cime[cir[i]]=true;
	for(i=1;i<=mem;i++) dp(cir[i]);
	printf(check()?"POSSIBLE\n":"IMPOSSIBLE\n");
    return 0;
}