#[allow(unused_macros)]
macro_rules! parse_line {
    ( $t:ty ) => (
        {
            let mut line = String::new();
            ::std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            iter.next().unwrap().parse::<$t>().unwrap()
        }
    );

    ( $( $t:ty), +) => (
        {
            let mut line = String::new();
            ::std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            ( $(iter.next().unwrap().parse::<$t>().unwrap()),* )
        }
    );
}

#[allow(unused_macros)]
macro_rules! read_line {
    () => (
        {
            let mut line = String::new();
            ::std::io::stdin().read_line(&mut line).unwrap();
            line.pop();
            line
        }
    )
}

#[allow(unused_macros)]
macro_rules! parse_vec {
    ( $t:ty ) => (
        {
            let mut line = String::new();
            ::std::io::stdin().read_line(&mut line).unwrap();
            let iter = line.split_whitespace();
            iter.map(|v| v.parse::<$t>().unwrap()).collect::<Vec<_>>()
        }
    )
}

mod dijkstra {
    use std::cmp::Ordering;
    use std::collections::BinaryHeap;

    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct State<T>
    {
        pub cost: usize,
        pub pos: T
    }

    pub trait ContextTrait<T>
    {
        fn cost(&self, pos: T) -> usize;
        fn update_cost(&mut self, s: &State<T>);
        fn neighbours(&self, s: &State<T>) -> Vec<State<T>>;

        fn run(&mut self, start: State<T>, end: T) -> Option<usize>
            where T: Copy+Ord {
            let mut heap = BinaryHeap::new();
            heap.push(start);

            while let Some(State {cost, pos}) = heap.pop() {
                if pos == end {
                    return Some(cost);
                }

                if cost > self.cost(pos) { continue; }

                for next in self.neighbours(&State {cost: cost, pos: pos}) {
                    if next.cost < self.cost(next.pos) {
                        self.update_cost(&next);
                        heap.push(next);
                    }
                }
            }
            None
        }
    }

    impl<T> Ord for State<T>
        where T: Copy+Ord {
        fn cmp(&self, other: &State<T>) -> Ordering {
            let c = other.cost.cmp(&self.cost);

            if c == Ordering::Equal {
                self.pos.cmp(&other.pos)
            } else {
                c
            }
        }
    }

    impl<T: Copy+Ord> PartialOrd for State<T> {
        fn partial_cmp(&self, other: &State<T>) -> Option<Ordering> {
            Some(self.cmp(other))
        }
    }
}

struct Context {
    costs: Vec<usize>,
    neighbours: Vec<Vec<usize>>
}

impl ContextTrait<usize> for Context {
    fn cost(&self, pos: usize) -> usize {
        self.costs[pos]
    }

    fn update_cost(&mut self, st: &State<usize>) {
        self.costs[st.pos] = st.cost;
    }

    fn neighbours(&self, s: &State<usize>) -> Vec<State<usize>> {
        let c = self.costs[s.pos];
        self.neighbours[s.pos].iter().map(|&p| State{cost: s.cost+1, pos: p}).collect()
    }
}

use dijkstra::*;

fn solve(n: usize, abs: Vec<(usize, usize)>) -> bool {
    let mut neighbours = vec![vec![]; n+1];

    for (a,b) in abs {
        neighbours[a].push(b);
        neighbours[b].push(a);
    }

    let mut context = Context{costs: vec![std::usize::MAX; n+1], neighbours: neighbours};

    match context.run(State::<usize>{cost: 0, pos:1}, n) {
        Some(c) => {
            c <= 2
        },
        None => {
            false
        }
    }
}

fn main() {
    let (n, m) = parse_line!(usize, usize);

    let abs = (0..m).map(|_| parse_line!(usize, usize)).collect();

    println!("{}", if solve(n, abs) { "POSSIBLE" } else { "IMPOSSIBLE" });
}

#[test]
fn solve_test() {
    assert_eq!(solve(3, vec![(1,2), (2,3)]), true);
    assert_eq!(solve(4, vec![(1,2), (2,3), (3,4)]), false);
    assert_eq!(solve(100000, vec![(1,99999)]), false);
    assert_eq!(solve(5, vec![(1,3), (4,5), (2,3), (2,4), (1,4)]), true);
}


Measured memory_bytes: 25872