#include <bits/stdc++.h>
using namespace std;
template <typename T>
void _R(T &x) {
  cin >> x;
}
void _R(int &x) { scanf("%d", &x); }
void _R(long long &x) { cin >> x; }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template <typename T, typename... U>
void R(T &head, U &...tail) {
  _R(head);
  R(tail...);
}
template <typename T>
void _W(const T &x) {
  cout << x;
}
void _W(const int &x) { printf("%d", x); }
template <typename T>
void _W(const vector<T> &x) {
  for (auto i = x.cbegin(); i != x.cend(); i++) {
    if (i != x.cbegin()) putchar(' ');
    _W(*i);
  }
}
void W() {}
template <typename T, typename... U>
void W(const T &head, const U &...tail) {
  _W(head);
  putchar(sizeof...(tail) ? ' ' : '\n');
  W(tail...);
}
template <class T>
inline void maz(T &a, T b) {
  if (a < b) a = b;
}
template <class T>
inline void miz(T &a, T b) {
  if (a > b) a = b;
}
template <class T>
inline T abs(T a) {
  return a > 0 ? a : -a;
}
const int N = 100010;
const int lgN = 17;
const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
int n, m;
vector<int> G[N];
int idx[N];
bool in[N] = {}, flag[N] = {};
int found = -1;
vector<int> C;
void init_find_c() {
  for (int i = 1; i <= n; i++) in[i] = false, flag[i] = false;
  found = -1;
  C.clear();
}
void find_c(int x) {
  in[x] = true;
  flag[x] = true;
  for (auto y : G[x])
    if (flag[y]) {
      if (in[y]) {
        found = y;
        return C.push_back(x);
      }
    } else {
      find_c(y);
      if (found != -1) {
        if (found != INF) C.push_back(x);
        if (found == x) found = INF;
        return;
      }
    }
  in[x] = false;
}
void update(int &ans, int x, int y) {
  int len1 = x - ans, len2 = x - y;
  if (len1 < 0) len1 += C.size();
  if (len2 < 0) len2 += C.size();
  if (len2 < len1) ans = y;
}
int go(int x, const int st) {
  static bool vst[N] = {};
  vst[x] = true;
  int ans = (st + 1) % C.size();
  for (auto y : G[x]) {
    if (idx[y] == -1 && !vst[y]) idx[y] = go(y, st);
    if (idx[y] != -1) update(ans, st, idx[y]);
  }
  return ans;
}
bool check(int xx) {
  G[xx].clear();
  init_find_c();
  for (int i = 1; i <= n; i++) {
    if (!flag[i]) find_c(i);
    if (C.size() != 0) return false;
  }
  return true;
}
int pv[N];
void cover(int x, int y) {
  ;
  x++;
  y++;
  if (x <= y) {
    pv[y]++;
    pv[x - 1]--;
  } else {
    pv[y]++;
    pv[C.size()]++;
    pv[x - 1]--;
  }
}
int main() {
  R(n, m);
  while (m--) {
    int x, y;
    R(x, y);
    G[x].push_back(y);
  }
  init_find_c();
  for (int i = 1; i <= n; i++)
    if (!flag[i]) {
      find_c(i);
      if (C.size() != 0) break;
    }
  reverse((C).begin(), (C).end());
  for (int i = 1; i <= n; i++) idx[i] = -1;
  for (int i = 0; i < C.size(); i++) idx[C[i]] = i;
  for (int i = 0; i < C.size(); i++) {
    int y = go(C[i], i);
    ;
    cover(y, i);
  }
  for (int i = 1; i <= n; i++)
    ;
  int now = 0, best = -1, id = 0;
  for (int i = C.size(); i >= 1; i--) {
    now += pv[i];
    if (best < now) best = now, id = i - 1;
  }
  if (check(C[id]))
    W(C[id]);
  else
    puts("-1");
  return 0;
}
