#pragma region kyomukyomupurin

/**
 *    author  : 𝒌𝒚𝒐𝒎𝒖𝒌𝒚𝒐𝒎𝒖𝒑𝒖𝒓𝒊𝒏
 *    created : 2020-04-24 21:52:31
 **/

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#include <cmath>
#include <complex>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

using int64 = long long;

template <class T>
using binary_heap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

template <class T, class U>
std::ostream& operator<<(std::ostream& os, const std::pair<T, U>& p) {
  return os << '(' << p.first << ", " << p.second << ')';
}

template <class T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) {
  int flag = 0;
  for (auto e : vec) os << (flag++ ? ", " : "{") << e;
  return os << '}';
}

template <class T>
std::ostream& operator<<(std::ostream& os, const std::set<T>& st) {
  int flag = 0;
  for (auto e : st) os << (flag++ ? ", " : "{") << e;
  return os << '}';
}

template <class T, class U>
std::ostream& operator<<(std::ostream& os, const std::map<T, U>& mp) {
  int flag = 0;
  for (auto e : mp) os << (flag++ ? ", " : "{") << e;
  return os << '}';
}

template <class T>
std::istream& operator>>(std::istream& is, std::vector<T>& vec) {
  for (T& e : vec) is >> e;
  return is;
}

#define all(_) begin(_), end(_)
#define rall(_) rbegin(_), rend(_)

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]: ", debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

void debug_out() { std::cerr << '\n'; }

template <class Head, class... Tail>
void debug_out(Head&& head, Tail&&... tail) {
  std::cerr << head;
  if (sizeof...(Tail) != 0) std::cerr << ", ";
  debug_out(std::forward<Tail>(tail)...);
}

#pragma endregion kyomukyomupurin

template <class _Tp>
class Dijkstra {
  template <class _Up>
  using binary_heap = std::priority_queue<_Up, std::vector<_Up>, std::greater<_Up>>;

 public:
  static constexpr _Tp kInfinity = std::numeric_limits<_Tp>::max() / static_cast<_Tp>(2);

  Dijkstra(int node_size) : node_size_(node_size), graph_(node_size) {}

  void add(int from, int to, _Tp cost) {
    assert(0 <= from && from < node_size_ && 0 <= to && to < node_size_);
    graph_[from].emplace_back((edge){to, cost});
  }

  void solve(int source) {
    assert(0 <= source && source < node_size_);
    distance_.assign(node_size_, kInfinity);
    binary_heap<std::pair<_Tp, int>> pq;
    distance_[source] = 0;
    pq.emplace(0, source);

    while (!pq.empty()) {
      std::pair<_Tp, int> cur = pq.top();
      pq.pop();
      int v = cur.second;
      if (distance_[v] < cur.first) continue;
      for (const edge& e : graph_[v]) {
        if (distance_[e.to] > distance_[v] + e.cost) {
          distance_[e.to] = distance_[v] + e.cost;
          pq.emplace(distance_[e.to], e.to);
        }
      }
    }
  }

  _Tp operator[](int to) const {
    assert(0 <= to && to < node_size_);
    return distance_[to];
  }

 private:
  struct edge {
    int to;
    _Tp cost;
  };
  int node_size_;
  std::vector<_Tp> distance_;
  std::vector<std::vector<edge>> graph_;
};

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);

  int n, m; cin >> n >> m;
  Dijkstra<int> d(n);

  for (int i = 0; i < m; ++i) {
    int a, b; cin >> a >> b;
    --a; --b;
    d.add(a, b, 1);
    d.add(b, a, 1);
  }

  d.solve(0);

  cout << (d[n - 1] == 2 ? "POSSIBLE" : "IMPOSSIBLE") << endl;

  return 0;
}

Measured memory_bytes: 15080