#include <bits/stdc++.h>
#pragma GCC optimize("-Ofast", "-funroll-all-loops")
using namespace std;
const int N = 5e5 + 10;
int n, m, dag[N], id[N], vis[N], flag, st[N];
int head[N], nex[N], to[N], tot;
inline void add(int a, int b) {
  to[++tot] = b;
  nex[tot] = head[a];
  head[a] = tot;
}
inline double find() { return clock() / (double)CLOCKS_PER_SEC; }
int cmp(int a, int b) { return dag[a] > dag[b]; }
void dfs(int x) {
  vis[x] = 1;
  for (int i = head[x]; i; i = nex[i]) {
    if (!vis[to[i]]) dfs(to[i]);
    if (vis[to[i]] == 1) flag = 1;
    if (flag) return;
  }
  vis[x] = 2;
}
inline int check(int x) {
  memset(vis, 0, sizeof vis);
  vis[x] = 2;
  flag = 0;
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) {
      dfs(i);
      if (flag) {
        for (int i = 1; i <= n; i++)
          if (vis[i] != 1) st[i] = 1;
        return 0;
      }
    }
  }
  return 1;
}
signed main() {
  cin >> n >> m;
  for (int i = 1, a, b; i <= m; i++) {
    scanf("%d %d", &a, &b), dag[a]++, add(a, b);
  }
  for (int i = 1; i <= n; i++) id[i] = i;
  sort(id + 1, id + 1 + n, cmp);
  for (int i = 1; i <= n; i++) {
    if (find() > 0.9) break;
    if (!st[id[i]] && check(id[i])) {
      cout << id[i];
      return 0;
    }
  }
  puts("-1");
  return 0;
}
