#include <bits/stdc++.h>
using namespace std;
const int mxN = 100010;
vector<int> g[mxN];
int vis[mxN];
int h[mxN];
int mn[mxN], mnI[mxN];
bool f = false;
vector<int> res;
vector<int> at;
vector<int> st;
void dfs(int v) {
  vis[v] = 1;
  mn[v] = h[v];
  mnI[v] = v;
  st.push_back(v);
  for (auto u : g[v]) {
    if (vis[u] == 1) {
      if (!f) {
        int cur = st.size() - 1;
        while (u != st[cur]) {
          res.push_back(st[cur--]);
        }
        res.push_back(u);
        at.clear();
        at.resize(res.size(), 0);
        reverse(res.begin(), res.end());
        f = true;
      } else {
        int lo = 0, hi = res.size() - 1, to = res.size();
        while (lo <= hi) {
          int md = (lo + hi) >> 1;
          if (vis[res[md]] == 1)
            lo = md + 1;
          else
            hi = md - 1, to = md;
        }
        while ((int)res.size() > to) {
          at.pop_back();
          res.pop_back();
        }
        lo = 0, hi = res.size() - 1, to = res.size();
        while (lo <= hi) {
          int md = (lo + hi) >> 1;
          if (h[res[md]] < h[u])
            lo = md + 1;
          else
            hi = md - 1, to = md;
        }
        if (!at.empty()) at[0]--;
        if (to < (int)at.size()) at[to]++;
      }
      if (h[u] <= mn[v]) {
        mn[v] = h[u];
        mnI[v] = u;
      }
    } else if (vis[u] == 2) {
      if (vis[mnI[u]] == 1) {
        int lo = 0, hi = res.size() - 1, toa = res.size(), tob = res.size();
        while (lo <= hi) {
          int md = (lo + hi) >> 1;
          if (vis[res[md]] == 1)
            lo = md + 1;
          else
            hi = md - 1, toa = md;
        }
        lo = 0, hi = res.size() - 1;
        while (lo <= hi) {
          int md = (lo + hi) >> 1;
          if (h[res[md]] < h[u])
            lo = md + 1;
          else
            hi = md - 1, tob = md;
          ;
        }
        if (toa < (int)at.size()) at[toa]--;
        if (tob < (int)at.size()) at[tob]++;
      }
      if (mn[u] < mn[v]) {
        mn[v] = mn[u];
        mnI[v] = mnI[u];
      }
    } else {
      h[u] = h[v] + 1;
      dfs(u);
      if (mn[u] < mn[v]) {
        mn[v] = mn[u];
        mnI[v] = mnI[u];
      }
    }
  }
  st.pop_back();
  vis[v] = 2;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int N, M, u, v;
  cin >> N >> M;
  for (int i = 0; i < M; i++) {
    cin >> u >> v;
    u--, v--;
    g[u].push_back(v);
  }
  f = false;
  for (int i = 0; i < N; i++)
    if (!vis[i]) dfs(i);
  u = -2;
  int cur = 0;
  for (int i = 0; i < (int)res.size(); i++) {
    cur += at[i];
    if (cur >= 0) u = res[i];
  }
  cout << u + 1;
}
