#include <cstdio>
const int N=200005;
int fst[N],nxt[N],p[N],q[N],deg[N],f[N];
bool u[N];
void addedge(int x,int y){
	nxt[y]=fst[x];fst[x]=y;
}
int calc(int x,bool bo){
	for (int i=fst[x];i;i=nxt[i]) if (!deg[i]) u[f[i]]=1;
	int y=0;
	for (;u[y];y++);
	if (bo) for (y++;u[y];y++);
	for (int i=fst[x];i;i=nxt[i]) u[f[i]]=0;
	return y;
}
bool check(int st,bool bo){
	for (int i=st;!deg[i];i=p[i]) deg[i]=1;
	f[st]=calc(st,bo);--deg[st];
	for (int i=p[st];i!=st;i=p[i]){
		f[i]=calc(i,0);
		deg[i]=0;
	}
	return calc(st,0)==f[st];
}
int main(){
	int n;
	scanf("%d\n",&n);
	for (int i=1;i<=n;i++){
		scanf("%d",&p[i]);
		addedge(p[i],i);
		deg[p[i]]++;
	}
	int head=1,tail=0;
	for (int i=1;i<=n;i++)
		if (!deg[i]) q[++tail]=i;
	for (;head<=tail;){
		int x=q[head++];
		if (!--deg[p[x]]) q[++tail]=p[x];
		f[x]=calc(x,0);
	}
	int st=0;
	for (int i=1;i<=n;i++)
		if (deg[i]) st=i;
	if (check(st,0) || check(st,1)) printf("POSSIBLE\n");
		else printf("IMPOSSIBLE\n");
}