#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const int MAXN = 1000100;

int N;
int arr[MAXN];
int pprev[MAXN];
vector <int> nnext[MAXN];
int res[MAXN];

bool spec[MAXN];
set <int> s[MAXN];

int gmex (int i, int opt)
{
    int ans = 0;
    while (ans == opt || s[i].find(ans) != s[i].end())
        ans++;
    return ans;
}

void flood (int cloc)
{
    for (int neigh : nnext[cloc])
        if (!spec[neigh])
        {
            flood (neigh);
            s[cloc].insert(res[neigh]);
        }
    res[cloc] = 0;
    while (s[cloc].find(res[cloc]) != s[cloc].end())
        res[cloc]++;
}

bool gogo (int cloc)
{
    int cr = res[cloc];
    int cstart = cloc;
    do
    {
        int cprev = pprev[cloc];
        res[cprev] = gmex (cprev, res[cloc]);
        cloc = cprev;
    } while (cloc != cstart);
    return cr == res[cstart];
}

int main()
{
    ios_base::sync_with_stdio(0);

    cin >> N;
    for (int i = 0; i < N; i++)
    {
        cin >> arr[i];
        arr[i]--;
        pprev[i] = arr[i];
        nnext[arr[i]].push_back(i);
    }

    int cloc = 0;
    for (int i = 0; i < N; i++)
        cloc = pprev[cloc];

    while (!spec[cloc])
    {
        spec[cloc] = true;
        cloc = pprev[cloc];
    }

    for (int i = 0; i < N; i++)
        if (spec[i]) flood (i);

    int clo = res[cloc];
    if (gogo (cloc))
    {
        cout << "POSSIBLE\n";
        return 0;
    }
    res[cloc] = gmex (cloc, clo);
    if (gogo (cloc))
    {
        cout << "POSSIBLE\n";
        return 0;
    }
    cout << "IMPOSSIBLE\n";
}