#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize("unroll-loops")
//#pragma warning(disable : 4996)

#ifdef _MSC_VER
#include <intrin.h>
#define __builtin_popcount __popcnt
#define __builtin_popcountll __popcnt64
#endif

#include <limits.h>
#include <math.h>
#include <time.h>

#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, m, n) for (int i = m; i < n; ++i)
#define FORR(i, m, n) for (int i = m - 1; i >= n; --i)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v, n) reverse(v, v + n);
#define VREVERSE(v) reverse(v.begin(), v.end())
#define ll long long
#define print(x) cout << (x) << '\n'
#define pe(x) cout << (x) << " "
#define DEBUG(x) cout << #x << ": " << x << endl
#define lb(v, n) lower_bound(v.begin(), v.end(), (n))
#define ub(v, n) upper_bound(v.begin(), v.end(), (n))
#define int long long
#define double long double
#define all(x) (x).begin(), (x).end()
#define print_space(v) REP(i, v.size()) cout << v[i] << ((i == v.size() - 1) ? "\n" : " ")
template <typename T1, typename T2> inline void chmin(T1& a, T2 b) { if (a > b) a = b; }
template <typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
std::random_device rd;
std::mt19937 mt(rd());
constexpr ll MOD = 1e9 + 7;
constexpr int MAX = 500050;
const double pi = acos(-1);
constexpr double EPS = 1e-8;
constexpr ll LINF = 1e18 + 1;
constexpr int INF = 1e9 + 1;

vector<int>G[200020];

int len = 0;
//void dfs(int s, int n, int res) {
//	if (n == s && res > 0) {
//		len = res; return;
//	}
//	for (auto nxt : G[n]) {
//		dfs(s, nxt, res + 1);
//	}
//}

int deg[200020];
int par[200020];
bool fix[200020];
int X[200020];

//int mex(int n) {
//	vector<int>v;
//	for (auto nxt : G[n]) {
//		if (fix[nxt])v.push_back(X[nxt]);
//	}
//	VSORT(v);
//	v.erase(unique(all(v)), v.end());
//	v.push_back(INF);
//	REP(i, v.size()) {
//		if (i != v[i])return i;
//	}
//}

int mex(vector<int>v) {
	VSORT(v);
	v.erase(unique(all(v)), v.end());
	//print_space(v);
	v.push_back(INF);
	REP(i, v.size()) {
		if (i != v[i]) {
			//DEBUG(i);
			return i;
		}
	}
	//return 1;
}


bool dfs(int s, int sx, int pre, int n, int prex) {
	if (n == s && pre != s) {
		vector<int>v;
		v.push_back(prex);
		for (auto nxt : G[n]) {
			if (fix[nxt])v.push_back(X[nxt]);
		}
		int m = mex(v);
		if (m == sx && m != prex)return true;
		else return false;
	}
	vector<int>v;
	v.push_back(prex);
	for (auto nxt : G[n]) {
		if (fix[nxt])v.push_back(X[nxt]);
	}
	int m = mex(v);
	return dfs(s, sx, n, par[n], m);
}

void solve() {
	int N; cin >> N;
	REP(i, N) {
		int u; cin >> u;
		u--;
		G[u].push_back(i);
		par[i] = u;
		deg[u]++;
	}
	queue<int>que;
	REP(i, N) {
		if (deg[i] == 0) {
			que.push(i);
		}
	}
	while (!que.empty()) {
		int pos = que.front(); que.pop();
		vector<int>v;
		for (auto nxt : G[pos]) {
			if (fix[nxt])v.push_back(X[nxt]);
		}
		fix[pos] = true;
		X[pos] = mex(v);
		deg[par[pos]]--;
		if (deg[par[pos]] == 0)que.push(par[pos]);
	}
	bool ok = false;
	REP(i, N) {
		if (!fix[i]) {
			vector<int>v;
			for (auto nxt : G[i]) {
				if (fix[nxt])v.push_back(X[nxt]);
			}
			int m = mex(v);
			set<int>st;
			for (auto x : v)st.insert(x);
			FOR(k, m + 1, INF) {
				if (!st.count(k)) {
					if (dfs(i, k, i, par[i], k))ok = true;
					break;
				}
			}
			if (dfs(i, m, i, par[i], m))ok = true;
			break;
		}
	}
	if (ok)print("POSSIBLE");
	else print("IMPOSSIBLE");
}



signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	//int q;
	//cin >> q;
	//while (q--)
	solve();
}


Measured memory_bytes: 49684