#include <bits/stdc++.h>
const int N = 100005;
using namespace std;
int b[N], use[N];
vector<int> e[N];
int tried[N], n, m;
bool dfs(int x) {
  if (b[x]) return 0;
  use[x] = 1;
  for (int i = 0; i < e[x].size(); i++) {
    int to = e[x][i];
    if (use[to] == 0) {
      if (dfs(to)) return 1;
    } else if (use[to] == 1) {
      for (int i = 0; i < n; ++i)
        if (use[i] != 1) tried[i] = 1;
      return 1;
    }
  }
  use[x] = 2;
  return 0;
}
int a[N];
bool check() {
  for (int i = 0; i < n; ++i) use[i] = 0;
  for (int i = 0; i < n; ++i)
    if (!use[i])
      if (dfs(i)) return 0;
  return 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    e[x].push_back(y);
  }
  for (int i = 0; i < n; ++i) a[i] = i;
  random_shuffle(a, a + n);
  for (int i = 0; (1.0 * clock() / CLOCKS_PER_SEC) < 0.95 && i < n; i++) {
    if (tried[a[i]]) continue;
    b[a[i]] = 1;
    if (check()) {
      cout << a[i] + 1;
      return 0;
    }
    b[a[i]] = 0;
  }
  cout << -1 << endl;
  return 0;
}
