#include <bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define FOR(i,a,b) for (int i = (a); i <= (b); ++i)
#define NFOR(i,a,b) for(int i = (a); i >= (b); --i)
#define all(x) (x).begin(), (x).end()
#define sz(x) int(x.size())
typedef long long ll; typedef pair <int, int> ii; typedef vector <int> vi; const int inf = 1e9 + 7;
#define pr(...) dbs(#__VA_ARGS__, __VA_ARGS__)
template <class T> void dbs(string str, T t) {cout << str << " : " << t << endl;}
template <class T, class... S> void dbs(string str, T t, S... s) {int idx = str.find(','); cout << str.substr(0, idx) << " : " << t << ","; dbs(str.substr(idx + 1), s...);}
template <class S, class T>ostream& operator <<(ostream& os, const pair<S, T>& p) {return os << "(" << p.first << ", " << p.second << ")";}
template <class T>ostream& operator <<(ostream& os, const vector<T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class T>ostream& operator <<(ostream& os, const set<T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class S, class T>ostream& operator <<(ostream& os, const map<S, T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class T> void prc(T a, T b) {cout << "["; for (T i = a; i != b; ++i) {if (i != a) cout << ", "; cout << *i;} cout << "]";cout<<endl;}

const int N = 2e5+10;
int n, p[N], c[N], val[N], val2[N];
vi g[N], col[N], id[N];


void visit(const vector<vector<int> > &g, int v,
		vector<int> &scccolor, int &colors,
		vector<int> &S, vector<char> &inS,
		vector<int> &low, vector<int> &num, int& time) {
	low[v] = num[v] = ++time;
	S.push_back(v); inS[v] = true;
	for(int e: g[v]) {
		int w = e;
		if (num[w] == 0) {
			visit(g, w, scccolor, colors, S, inS, low, num, time);
			low[v] = min(low[v], low[w]);
		} else if (inS[w])
			low[v] = min(low[v], num[w]);
	}
	if (low[v] == num[v]) {
		while (1) {
			int w = S.back(); S.pop_back(); inS[w] = false;
			scccolor[w] = colors;
			if (v == w) break;
		}
		colors ++;
	}
}
int stronglyConnectedComponents(const vector<vector<int> >& g,
		vector<int>& scccolor) {
	const int n = g.size();
	vector<int> num(n), low(n);
	vector<int> S;
	vector<char> inS(n);
	scccolor.resize(n);
	int time = 0, colors = 0;
	for (int u = 0; u < n; ++u) if (num[u] == 0)
		visit(g, u, scccolor, colors, S, inS, low, num, time);
	return colors;
}

bool two_satisfiability(const vector<vi> &g) {
	int n = g.size() / 2;
	vi scccolor;
	stronglyConnectedComponents(g, scccolor);
	for (int i = 0; i < n; ++i) if(scccolor[i] == scccolor[n+i]) return false;
	return true;
}

int mex(int x) {
	int &ans = val[x];
	if (~ans) return ans;
	ans = 0;
	set<int> s;
	for (int y : g[x]) if (!c[y]) {
		s.insert(mex(y));
	}
	while (s.count(ans)) ++ans;
	return ans;
}

int main()
{
	ios::sync_with_stdio(0); cin.tie(0);

	cin >> n; FOR (i, 1, n) cin >> p[i], g[p[i]].push_back(i);

	int y = 1, z = p[1];
	while (y != z) y = p[y], z = p[p[z]];

	vector<int> cycle;
	do {
		cycle.push_back(z);
		c[z] = 1;
		z = p[z];
	} while (z != y);

	reverse(all(cycle));

	memset(val, -1, sizeof val);
	FOR (x, 1, n) if (c[x]) {
		set<int> s;
		for (int y : g[x]) if (!c[y]) s.insert(mex(y));
		s.insert(mex(x));
		while (s.count(val2[x])) ++val2[x];
	}
	
	int no = 0;

	FOR (I, 0, sz(cycle) - 1) {
		int i = cycle[I];
		int j = cycle[(I + 1) % sz(cycle)];
		col[I].push_back(mex(i));
		id[I].push_back(no++);
		if (mex(j) == mex(i) or val2[j] == mex(i)) {
			col[I].push_back(val2[i]);
			id[I].push_back(no++);
		}
	}
	vector<vi> BG(2*no);

	FOR (i, 0, sz(cycle) - 1) {
		int j = (i + 1) % sz(cycle);
		int cur = sz(col[i]);
		FOR (k, 0, sz(col[i]) - 1) {
			FOR (l, 0, sz(col[j]) - 1) {
				if (col[i][k] == col[j][l]) {
					int x = id[i][k], y = id[j][l];
					BG[x].push_back(y+no);
					BG[y+no].push_back(x);
					BG[y].push_back(x+no);
					BG[x+no].push_back(y);
				}
			}
		}
		if (cur > 1) {
			int x = id[i][0], y = id[i][1];
			BG[x].push_back(y+no);
			BG[y+no].push_back(x);
			BG[y].push_back(x+no);
			BG[x+no].push_back(y);

			int pos = 0;
			if (sz(col[j]) > 1 and col[j][1] == col[i][0]) ++pos;
			BG[id[i][1]].push_back(id[j][pos]);
		}
	}


	cout << (two_satisfiability(BG) ? "POSSIBLE\n" : "IMPOSSIBLE\n");


	return 0;
}


Measured memory_bytes: 75636