use std::collections::BTreeSet;

fn main() {
    let s = std::io::stdin();
    let mut sc = Scanner { stdin: s.lock() };
    let n: usize = sc.read();
    let p: Vec<usize> = (0..n).map(|_| sc.read::<usize>() - 1).collect();
    let mut graph = vec![vec![]; n];
    for (i, &p) in p.iter().enumerate() {
        graph[p].push(i);
    }

    let mut vis = vec![false; n];
    let mut cur = 0;
    while !vis[cur] {
        vis[cur] = true;
        cur = p[cur];
    }

    assert_eq!(
        {
            let mut vis = vec![false; n];
            let mut cur = 0;
            loop {
                if vis[cur] {
                    break;
                }
                vis[cur] = true;
                cur = p[cur];
            }
            cur
        }, cur);

    let mut in_cycle = vec![false; n];
    while !in_cycle[cur] {
        in_cycle[cur] = true;
        cur = p[cur];
    }

    assert_eq!(
        {
            let mut is_cycle = vec![false; n];
            let mut cur = cur;
            loop {
                if is_cycle[cur] {
                    break;
                }
                is_cycle[cur] = true;
                cur = p[cur];
            }
            is_cycle
        }, in_cycle);

    let mut grundy = vec![n; n];
    for i in in_cycle.iter().enumerate().filter(|&(_, &in_cycle)| in_cycle).map(|(i, _)| i) {
        for &child in graph[i].iter() {
            if !in_cycle[child] {
                dfs(child, &graph, &mut grundy);
            }
        }
    }

    let check = |first: usize, grundy: &mut Vec<usize>| -> bool{
        let mut cur = p[first];
        loop {
            let set = graph[cur].iter().map(|&next| grundy[next]).collect::<BTreeSet<usize>>();
            let g = (0..).filter(|i| !set.contains(i)).next().unwrap();

            if cur == first {
                if g == grundy[first] {
                    return true;
                } else {
                    return false;
                }
            } else {
                grundy[cur] = g;
                cur = p[cur];
            }
        }
    };

    let first = cur;
    let set = graph[first].iter().map(|&next| grundy[next]).collect::<BTreeSet<usize>>();
    let mut iter = (0..).filter(|i| !set.contains(i));
    let candidate1 = iter.next().unwrap();
    grundy[first] = candidate1;
    if check(first, &mut grundy) {
        println!("POSSIBLE");
        return;
    }


    let candidate2 = iter.next().unwrap();
    grundy[first] = candidate2;
    if check(first, &mut grundy) {
        println!("POSSIBLE");
        return;
    }
    println!("IMPOSSIBLE");
}

fn dfs(v: usize, graph: &Vec<Vec<usize>>, grundy: &mut Vec<usize>) -> usize {
    let set = graph[v].iter().map(|&child| dfs(child, graph, grundy)).collect::<BTreeSet<usize>>();
    grundy[v] = (0..).filter(|i| !set.contains(i)).next().unwrap();
    grundy[v]
}

pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n')
            .take_while(|&b| b != b' ' && b != b'\n')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 18684