#include <bits/stdc++.h>
using namespace std;
const long long int inf = 0x3f3f3f3f;
const int mx = 2e5 + 5;
const int mod = 1e9 + 7;
const int x_move[] = {1, -1, 0, 0, 1, 1, -1, -1};
const int y_move[] = {0, 0, 1, -1, 1, -1, 1, -1};
int n, m;
vector<int> g[mx], a[mx], b[mx];
int cir[mx];
int id[mx];
int low[mx], pre[mx], ssc[mx];
int dp[mx];
int vis[mx];
bool ok;
int num[mx];
stack<int> st;
int dfn, cnt;
int sum, bg;
struct node {
  int a, b;
  node() {
    a = 3e6;
    b = 0;
  }
  friend node operator+(node &o, node &p) {
    node z;
    z.a = min(o.a, p.a);
    z.b = max(o.b, p.b);
    return z;
  }
  friend node operator+(node &o, int p) {
    node z;
    z.a = min(o.a, p);
    z.b = max(o.b, p);
    return z;
  }
} fr[mx], ba[mx];
void tarjan(int u) {
  pre[u] = low[u] = ++dfn;
  st.push(u);
  for (auto v : g[u]) {
    if (!pre[v]) {
      tarjan(v);
      low[u] = min(low[u], low[v]);
    } else if (!ssc[v])
      low[u] = min(low[u], pre[v]);
  }
  if (low[u] == pre[u]) {
    cnt++;
    if (st.top() != u) sum++;
    while (1) {
      int x = st.top();
      st.pop();
      ssc[x] = cnt;
      num[cnt]++;
      if (x == u) break;
    }
  }
}
bool dfs(int u) {
  if (vis[u] && u == bg) return true;
  if (vis[u]) return false;
  vis[u] = 1;
  cir[++cir[0]] = u;
  for (auto v : g[u])
    if (dfs(v)) return true;
  cir[0]--;
  return false;
}
void dfs1(int u) {
  vis[u] = 1;
  for (auto v : a[u]) {
    if (!id[v]) {
      if (!vis[v])
        dfs1(v);
      else if (vis[v] == 1)
        ok = false;
    }
    if (id[v])
      fr[u] = fr[u] + id[v];
    else
      fr[u] = fr[v] + fr[u];
  }
  vis[u] = 2;
}
void dfs2(int u) {
  vis[u] = 1;
  for (auto v : b[u]) {
    if (!id[v]) {
      if (!vis[v])
        dfs2(v);
      else if (vis[v] == 1)
        ok = false;
    }
    if (id[v])
      ba[u] = ba[u] + id[v];
    else
      ba[u] = ba[u] + ba[v];
  }
  vis[u] = 2;
}
void add(int l, int r) {
  if (r < l) return;
  dp[l]++;
  dp[r + 1]--;
}
int solve() {
  for (int i = 1; i <= cir[0]; i++) id[cir[i]] = i;
  for (int u = 1; u <= n; u++) {
    for (auto v : g[u]) {
      if (id[v] == id[u] % cir[0] + 1) continue;
      a[u].push_back(v);
      b[v].push_back(u);
    }
  }
  for (int u = 1; u <= n; u++) g[u] = a[u];
  dfn = cnt = sum = 0;
  memset(pre, 0, sizeof(pre));
  memset(ssc, 0, sizeof(ssc));
  for (int i = 1; i <= n; i++)
    if (!pre[i]) tarjan(i);
  if (sum > 1) return -1;
  memset(vis, 0, sizeof(vis));
  for (int i = 1; i <= n; i++)
    if (!vis[i]) dfs1(i);
  memset(vis, 0, sizeof(vis));
  for (int i = 1; i <= n; i++)
    if (!vis[i]) dfs2(i);
  if (!ok) return -1;
  for (int i = 1; i <= cir[0]; i++) {
    if (fr[cir[i]].b >= i) add(i + 1, fr[cir[i]].b - 1);
    if (fr[cir[i]].a <= i) add(i + 1, cir[0]);
    if (ba[cir[i]].b >= i) add(1, i - 1);
  }
  for (int i = 1; i <= cir[0]; i++) {
    dp[i] += dp[i - 1];
    if (!dp[i]) return cir[i];
  }
  return -1;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    g[u].push_back(v);
  }
  cir[0] = n;
  for (int i = 1; i <= n; i++)
    if (!pre[i]) tarjan(i);
  if (sum > 1) return 0 * puts("-1");
  for (int i = 1; i <= n; i++)
    if (num[ssc[i]] > 1) bg = i;
  cir[0] = 0;
  ok = true;
  dfs(bg);
  printf("%d\n", solve());
  return 0;
}
