#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const int MAXN = 1.1e5;
vector<int> adj[MAXN];
vector<int> rev[MAXN];
vector<int> cycle;
int cid[MAXN];
int mark[MAXN];
int mcid[MAXN];
int rek1(int n) {
  if (mark[n] == -2) {
    return n;
  } else if (mark[n] == -1) {
    mark[n] = -2;
    for (auto to : adj[n]) {
      auto r = rek1(to);
      if (r == -2) return -2;
      if (r != -1) {
        cycle.push_back(n);
        if (n == r) return -2;
        return r;
      }
    }
    mark[n] = -3;
  }
  return -1;
}
void rek_max_cid(int n) {
  if (mark[n] == -1) {
    mark[n] = -2;
    if (cid[n] != -1) {
      mark[n] = -3;
      mcid[n] = cid[n];
      return;
    }
    mcid[n] = -1;
    for (auto to : adj[n]) {
      rek_max_cid(to);
      mcid[n] = max(mcid[n], mcid[to]);
    }
    mark[n] = -3;
  } else {
    assert(mark[n] == -3);
  }
}
bool failed = false;
int rek_max_cid2(int n, int ub) {
  if (mark[n] == -1) {
    mark[n] = -2;
    if (cid[n] != -1) {
      mark[n] = -3;
      mcid[n] = cid[n];
      if (ub < mcid[n]) return -1;
      return mcid[n];
    }
    mcid[n] = -1;
    for (auto to : adj[n]) {
      rek_max_cid2(to, ub);
      if (mcid[to] <= ub) {
        mcid[n] = max(mcid[n], mcid[to]);
      }
    }
    mark[n] = -3;
    if (ub < mcid[n]) return -1;
    return mcid[n];
  } else {
    if (mark[n] != -3) {
      failed = true;
      return ub;
    }
    assert(mark[n] == -3);
  }
  if (ub < mcid[n]) return -1;
  return mcid[n];
}
int main() {
  int N, M;
  if (0 == scanf("%d%d", &N, &M)) {
    fprintf(stderr, "Could not parse arguments\n");
  };
  for (int i = (1); i < (N + 1); i++) adj[i].clear();
  for (int i = (1); i < (N + 1); i++) rev[i].clear();
  for (int i = (0); i < (M); i++) {
    int a, b;
    if (0 == scanf("%d%d", &a, &b)) {
      fprintf(stderr, "Could not parse arguments\n");
    };
    adj[a].push_back(b);
    rev[b].push_back(a);
  }
  cycle.clear();
  for (int i = (1); i < (N + 1); i++) mark[i] = -1;
  for (int i = (1); i < (N + 1); i++) {
    int r = rek1(i);
    if (r != -1) break;
  }
  if (int((cycle).size()) == 0) {
    cout << -1 << endl;
    return 0;
  }
  reverse((cycle).begin(), (cycle).end());
  for (int i = (1); i < (N + 1); i++) cid[i] = -1;
  for (int i = (0); i < (int((cycle).size())); i++) {
    cid[cycle[i]] = i;
  }
  for (int i = (1); i < (N + 1); i++) mark[i] = -1;
  for (auto n : cycle) mark[n] = -3;
  for (int n = (1); n < (N + 1); n++) {
    if (rek1(n) != -1) {
      cout << -1 << endl;
      return 0;
    }
  }
  for (int i = (1); i < (N + 1); i++) mark[i] = -1;
  for (int i = (1); i < (N + 1); i++) mcid[i] = -1;
  for (int i = (1); i < (N + 1); i++) {
    rek_max_cid(i);
  }
  {
    vector<int> ncycle;
    int next = 0;
    for (int i = (0); i < (int((cycle).size())); i++) {
      if (next == i) ncycle.push_back(cycle[i]);
      for (auto to : adj[cycle[i]]) {
        next = max(next, mcid[to]);
      }
    }
    cycle = ncycle;
  }
  for (int i = (1); i < (N + 1); i++) mark[i] = -1;
  for (int i = (1); i < (N + 1); i++) mcid[i] = -1;
  for (int i = (1); i < (N + 1); i++) cid[i] = -1;
  for (int i = (0); i < (int((cycle).size())); i++) {
    cid[cycle[i]] = i;
  }
  failed = false;
  int starting = 0, ending = int((cycle).size());
  for (int i = int(int((cycle).size())) - 1; i >= (starting); i--) {
    int tmp = -1;
    for (auto to : adj[cycle[i]]) {
      tmp = max(tmp, rek_max_cid2(to, i));
    }
    if (tmp >= starting) {
      starting = tmp;
      ending = i + 1;
    }
  }
  if (failed) {
    cout << -1 << endl;
    return 0;
  }
  for (int i = (1); i < (N + 1); i++) mark[i] = -1;
  for (int i = (starting); i < (ending); i++) mark[cycle[i]] = -3;
  for (int n = (1); n < (N + 1); n++) {
    if (rek1(n) != -1) {
      cout << -1 << endl;
      return 0;
    }
  }
  cout << cycle[starting] << endl;
  return 0;
}
