#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <stack>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <bitset>
#include <fstream>

using namespace std;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pii pair <int, int>
#define pll pair <long long, long long>
#define vi vector <int>
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;

const int N = 2e5 + 5;
int a, to[N], col[N], start_cycle, n;
vi from[N];
bool was[N], in_cycle[N];

void dfs(int x, int start)
{
	if(was[x])
		return;
	was[x] = true;
	for(int to : from[x])
	{
		if(to == start)
			start_cycle = start;
		dfs(to, start);
	}
}

void get_color(int x)
{
	if(col[x] != -1)
		return;
	vector <int> have;
	for(int to : from[x])
	{
		if(col[to] != -1)
		{
			have.pb(col[to]);
			continue;
		}
		get_color(to);
		have.pb(col[to]);
	}
	sort(have.begin(), have.end());
	int to_color = 0;
	for(int c : have)
	{
		if(c > to_color)
			break;
		if(c < to_color)
			continue;
		to_color++;
	}
	col[x] = to_color;
}

bool check()
{
	for(int i = 0; i < n; i++)
	{
		int cnt = 0;
		for(int to : from[i])
		{
			int c = col[to];
			if(c == col[i])
				return false;
		}
		if(col[i] == 0)
			continue;
		bool have[col[i]];
		for(int j = 0; j < col[i]; j++)
			have[j] = false;
		for(int to : from[i])
		{
			int c = col[to];
			if(c >= col[i])
				continue;
			if(!have[c])
			{
				cnt++;
				have[c] = true;
			}
		}
		//cout << i << " " << cnt << endl;
		if(cnt != col[i])
			return false;
	}
	return true;
}

int main()
{
	ios:: sync_with_stdio(false);
	cin >> n;
	for(int i = 0; i < n; i++)
	{
		int a;
		cin >> a;
		a--;
		to[i] = a;
		from[a].pb(i);
	}
	start_cycle = -1;
	for(int i = 0; i < n; i++)
		dfs(i, i);
	int cur = start_cycle;
	//cout << start_cycle << endl;
	while(!in_cycle[cur])
	{
		in_cycle[cur] = true;
		cur = to[cur];
	}
	for(int i = 0; i < n; i++)
		col[i] = -1;
	for(int i = 0; i < n; i++)
	{
		if(in_cycle[i])
			continue;
		if(col[i] != -1)
			continue;
		get_color(i);
	}
	//for(int i = 0; i < n; i++)
	//	cout << in_cycle[i];
	//cout << endl;
	for(int i = 0; i < n; i++)
		if(in_cycle[i])
		{
			a = i;
			break;
		}
	vi have;
	for(int to : from[a])
	{
		if(col[to] == -1)
			continue;
		have.pb(col[to]);
	}
	sort(have.begin(), have.end());
	int to_color = 0;
	for(int c : have)
	{
		if(c > to_color)
			break;
		if(c < to_color)
			continue;
		to_color++;
	}
	int next_color = to_color + 1;
	for(int c : have)
	{
		if(c < next_color)
			continue;
		if(c > next_color)
			break;
		next_color++;
	}
	col[a] = to_color;
	cur = to[a];
	//cout << a << endl;
	while(cur != a)
	{
		//for(int i = 0; i < n; i++)
		//	cout << col[i] << " ";
		//cout << endl;
		get_color(cur);
		cur = to[cur];
	}
	//for(int i = 0; i < n; i++)
	//	cout << col[i] << " ";
	//cout << endl;
	if(check())
	{
		cout << "POSSIBLE";
		return 0;
	}
	for(int i = 0; i < n; i++)
		if(in_cycle[i])
			col[i] = -1;
	col[a] = next_color;
	cur = to[a];
	while(cur != a)
	{
		//for(int i = 0; i < n; i++)
		//	cout << col[i] << " ";
		//cout << endl;
		get_color(cur);
		cur = to[cur];
	}
	//for(int i = 0; i < n; i++)
	//	cout << col[i] << " ";
	//cout << endl;
	if(check())
	{
		cout << "POSSIBLE";
		return 0;
	}
	cout << "IMPOSSIBLE";
	return 0;
}


Measured memory_bytes: 17408