# include <bits/stdc++.h>

/*
// ordered_set 
# include <ext/pb_ds/assoc_container.hpp>
# include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
# define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
*/
 
using namespace std;
 
typedef long long                                        ll;
typedef long double                                      ld;
typedef pair <int, int>                                  pii;
typedef pair <pii, int>                                  ppi;
typedef pair <int, pii>                                  pip;
typedef pair <pii, pii>                                  ppp;
typedef pair <ll, ll>                                    pll;
 
# define A                                               first
# define B                                               second
# define endl                                            '\n'
# define sep                                             ' '
# define all(x)                                          x.begin(), x.end()
# define kill(x)                                         return cout << x << endl, 0
# define SZ(x)                                           int(x.size())
# define Sort(x)                                         sort(all(x))
# define InTheNameOfGod                                  ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
 
ll power(ll a, ll b, ll md) {return (!b ? 1 : (b & 1 ? a * power(a * a % md, b / 2, md) % md : power(a * a % md, b / 2, md) % md));}

//const ll md = 1e9 + 7;//998244353;
const int xn = 2e5 + 10;
const int xm = 1e2 + 10;
const int SQ = 320;
const int sq = 320 + 10;
const int inf = 1e9 + 10;
const ll INF = 1e18 + 10;
const int Md = 998244353;
const int TM = 3;
const int Base = 257;

int n, p[xn], num[xn], root;
pii mex[xn];
pair <bool, bool> dp[xn];
vector <int> adj[xn], cyc, bach[xn];
bool mark[xn], flag[xn];

bool CMP(int v, int u){ return num[v] < num[u];}

void DFS2(int v){
	for (int u : adj[v]) if (!flag[u]) DFS2(u), bach[v].push_back(u);
	sort(all(bach[v]), CMP);
	if (!SZ(bach[v]) || num[bach[v][0]]) num[v] = 0;
	else{
		for (int i = 0; i < SZ(bach[v]); ++ i){
			if (i + 1 == SZ(bach[v]) || (num[bach[v][i + 1]] - num[bach[v][i]]) > 1){
				num[v] = num[bach[v][i]] + 1;
				break;
			}
		}
	}
}
void DFS(int v){
	mark[v] = true;
	for (int u : adj[v]) if (!mark[u]) DFS(u);
}

int main(){
    InTheNameOfGod;
    
    cin >> n;
    for (int i = 1; i <= n; ++ i){
    	cin >> p[i];
    	adj[p[i]].push_back(i);
	}
	for (int i = 1; i <= n; ++ i){
		if (mark[i]) continue;
		DFS(i);
		root = i;
	}
	int v = root;
	cyc.push_back(root);
	while (p[v] != root) cyc.push_back(p[v]), v = p[v];
	for (int v : cyc) flag[v] = true;
	for (int v : cyc) DFS2(v);
	for (int v : cyc){
		mex[v].A = num[v];
		bach[v].push_back(v);
		sort(all(bach[v]), CMP);
		for (int i = 0; i < SZ(bach[v]); ++ i){
			if (i + 1 == SZ(bach[v]) || num[bach[v][i + 1]] - num[bach[v][i]] > 1){
				num[v] = num[bach[v][i]] + 1;
				break;
			}
		}
		mex[v].B = num[v];
	}
	dp[cyc[0]].A = true;
	for (int i = 1; i < SZ(cyc); ++ i){
		int v = cyc[i], u = cyc[i - 1];
		if (mex[v].A == mex[u].A) dp[v].B |= dp[u].A;
		else dp[v].A |= dp[u].A;
		if (mex[v].A == mex[u].B) dp[v].B |= dp[u].B;
		else dp[v].A |= dp[u].B;
	}
	if (mex[cyc.back()].A != mex[cyc[0]].A && dp[cyc.back()].A) kill("POSSIBLE");
	if (mex[cyc.back()].B != mex[cyc[0]].A && dp[cyc.back()].B) kill("POSSIBLE");
	
	memset(dp, false, sizeof dp);
	
	dp[cyc[0]].B = true;
	for (int i = 1; i < SZ(cyc); ++ i){
		int v = cyc[i], u = cyc[i - 1];
		if (mex[v].A == mex[u].A) dp[v].B |= dp[u].A;
		else dp[v].A |= dp[u].A;
		if (mex[v].A == mex[u].B) dp[v].B |= dp[u].B;
		else dp[v].A |= dp[u].B;
	}
	if (mex[cyc.back()].A == mex[cyc[0]].A && dp[cyc.back()].A) kill("POSSIBLE");
	if (mex[cyc.back()].B == mex[cyc[0]].A && dp[cyc.back()].B) kill("POSSIBLE");
	
	kill("IMPOSSIBLE");
	
    return 0;
}


Measured memory_bytes: 29940