#include <iostream>
#include <algorithm>
#include <utility>
#include <numeric>
#include <vector>
#include <array>
#include <queue>

template <class T, class U>
inline bool chmin(T &lhs, const U &rhs) {
  if (lhs > rhs) { lhs = rhs; return true; }
  return false;
}

template <class T, class U>
inline bool chmax(T &lhs, const U &rhs) {
  if (lhs < rhs) { lhs = rhs; return true; }
  return false;
}

struct range {
  using itr = int64_t;
  struct iterator {
    itr i;
    constexpr iterator(itr i_): i(i_) { }
    constexpr void operator ++ () { ++i; }
    constexpr itr operator * () const { return i; }
    constexpr bool operator != (iterator x) const { return i != x.i; }
  };
  const iterator l, r;
  constexpr range(itr l_, itr r_): l(l_), r(std::max(l_, r_)) { }
  constexpr iterator begin() const { return l; }
  constexpr iterator end() const { return r; }
};

struct revrange {
  using itr = int64_t;
  struct iterator {
    itr i;
    constexpr iterator(itr i_): i(i_) { }
    constexpr void operator ++ () { --i; }
    constexpr itr operator * () const { return i; }
    constexpr bool operator != (iterator x) const { return i != x.i; }
  };
  const iterator l, r;
  constexpr revrange(itr l_, itr r_): l(l_ - 1), r(std::max(l_, r_) - 1) { }
  constexpr iterator begin() const { return r; }
  constexpr iterator end() const { return l; }
};

using i32 = int32_t;
using i64 = int64_t;
using u32 = uint32_t;
using u64 = uint64_t;

constexpr i32 inf32 = (i32(1) << 30) - 1;
constexpr i64 inf64 = (i64(1) << 62) - 1;

i32 calc_mex(std::vector<i32> vec) {
  std::sort(vec.begin(), vec.end());
  i32 res = 0;
  for (auto x: vec) {
    if (res < x) return res;
    ++res;
  }
  return res;
}

int main() {
  i32 N;
  std::cin >> N;
  std::vector<i32> parent(N);
  std::vector<i32> degree(N);
  for (auto &x: parent) {
    std::cin >> x;
    --x;
    ++degree[x];
  }
  std::queue<i32> que;
  for (auto i: range(0, N)) {
    if (degree[i] == 0) {
      que.push(i);
    }
  }
  std::vector<i32> num(N, -1);
  std::vector<std::vector<i32>> children(N); 
  while (!que.empty()) {
    i32 u = que.front();
    que.pop();
    num[u] = calc_mex(children[u]);
    children[parent[u]].push_back(num[u]);
    --degree[parent[u]];
    if (degree[parent[u]] == 0) {
      que.push(parent[u]);
    }
  }
  std::vector<i32> cycle;
  for (auto i: range(0, N)) {
    if (num[i] == -1) {
      cycle.push_back(i);
    }
  }
  i32 last = cycle.front();
  i32 first = parent[last];
  std::sort(children[first].begin(), children[first].end());
  i32 mex = 0, mex2 = -1;
  for (auto x: children[first]) {
    if (mex < x) {
      if (mex2 == -1) mex2 = mex;
      else break;
    }
    ++mex;
  }
  if (mex2 == -1) {
    mex2 = mex;
    ++mex;
  }
  auto fill_in = [&](i32 initial) {
    i32 cur = first;
    num[cur] = initial;
    while (parent[cur] != first) {
      auto vec = children[parent[cur]];
      vec.push_back(num[cur]);
      cur = parent[cur];
      num[cur] = calc_mex(vec);
    }
  };
  fill_in(mex);
  if (num[last] == mex2) {
    std::cout << "POSSIBLE\n";
    return 0;
  }
  fill_in(mex2);
  if (num[last] != mex2) {
    std::cout << "POSSIBLE\n";
    return 0;
  }
  std::cout << "IMPOSSIBLE\n";
  return 0;
}


Measured memory_bytes: 9984