#include <bits/stdc++.h>
using namespace std;
pair<int, int> edgeall[555555];
const int MAXN = 1e6 + 10;
int n, m, cycleLength, indexOnCycle[MAXN];
vector<int> out[MAXN];
int visited[MAXN];
vector<int> cycle;
void cutCycle(int v) {
  reverse(cycle.begin(), cycle.end());
  while (cycle.back() != v) {
    cycle.pop_back();
  }
  reverse(cycle.begin(), cycle.end());
  cycleLength = int(cycle.size());
}
bool dfsFindAnyCycle(int u) {
  cycle.push_back(u);
  visited[u] = 1;
  for (int i = 0; i < int(out[u].size()); i++) {
    int v = out[u][i];
    if (!visited[v]) {
      if (dfsFindAnyCycle(v)) {
        visited[u] = 2;
        return true;
      }
    } else {
      if (visited[v] == 1) {
        cutCycle(v);
        visited[u] = 2;
        return true;
      }
    }
  }
  visited[u] = 2;
  cycle.pop_back();
  return false;
}
vector<pair<int, int> > jumps;
int where[MAXN], alias[MAXN], posalias[MAXN];
int dfsJumpThruCycle(int u) {
  if (0) printf("dfsJumpThruCycle(%d)\n", u);
  if (indexOnCycle[u] == 0) {
    visited[u] = true;
  }
  int ret = -1;
  for (int i = 0; i < int(out[u].size()); i++) {
    int v = out[u][i];
    if (0) printf("u = %d v = %d\n", u, v);
    if (!visited[v]) {
      if (indexOnCycle[v] != 0) {
        ret = max(ret, alias[v]);
      } else {
        ret = max(ret, dfsJumpThruCycle(v));
      }
    } else {
      if (where[v] != -1) {
        ret = max(ret, where[v] > cycleLength ? where[v] : posalias[where[v]]);
      }
      if (0) printf("**u = %d v = %d\n", u, v);
      if (0) printf("**where[%d] = %d\n", v, where[v]);
      if (where[v] != -1)
        if (0) printf("**posalias[where[%d]] = %d\n", v, posalias[where[v]]);
    }
  }
  if (0) printf("where[%d] = %d\n", u, ret);
  where[u] = ret;
  return ret;
}
vector<int> mergeJumps() {
  vector<pair<int, int> > merged;
  int b = 0, e = 0;
  for (int i = 0; i < int(jumps.size()); i++) {
    int nb = jumps[i].first, ne = jumps[i].second;
    if (nb <= e) {
      e = max(e, ne);
    } else {
      merged.push_back(make_pair(b, e));
      b = nb;
      e = ne;
    }
  }
  merged.push_back(make_pair(b, e));
  for (int i = 0; i < int(merged.size()); i++) {
    for (int p = merged[i].first; p <= merged[i].second; p++) {
      indexOnCycle[cycle[(p - 1) % cycleLength + 1]] = 0;
    }
  }
  int kochamjulie = 0;
  vector<int> julcia;
  for (int i = 1; i <= n; i++) {
    if (indexOnCycle[i] != 0) {
      julcia.push_back(i);
    }
  }
  return julcia;
}
int lastResult = MAXN;
bool cmp_index(int a, int b) { return indexOnCycle[a] < indexOnCycle[b]; }
int tryCycle() {
  fill(visited + 1, visited + n + 1, false);
  fill(alias + 1, alias + n + 1, false);
  fill(posalias + 1, posalias + n + 1, false);
  fill(indexOnCycle + 1, indexOnCycle + n + 1, false);
  jumps.clear();
  cycleLength = int(cycle.size());
  for (int i = 1; i <= n; i++) where[i] = i;
  if (0) printf("Cycle found (%d):\n", cycleLength);
  cycle.insert(cycle.begin(), 0);
  for (int i = 1; i < int(cycle.size()); i++) {
    if (0) printf("%d\n", cycle[i]);
    indexOnCycle[cycle[i]] = i;
    alias[cycle[i]] = i;
    posalias[i] = i;
  }
  for (int i = 1; i <= cycleLength; i++) {
    alias[cycle[i]] += cycleLength;
    posalias[i] += cycleLength;
    int w = dfsJumpThruCycle(cycle[i]);
    if (0) printf("%d: %d\n", i, w);
    if (w != -1 && w > i + 1) {
      jumps.push_back(make_pair(i + 1, w - 1));
    }
  }
  cycle = mergeJumps();
  sort(cycle.begin(), cycle.end(), cmp_index);
  return int(cycle.size());
}
bool dfsCheckCycleExistence(int u) {
  visited[u] = 1;
  for (int i = 0; i < int(out[u].size()); i++) {
    int v = out[u][i];
    if (!visited[v]) {
      if (dfsCheckCycleExistence(v)) {
        visited[u] = 2;
        return true;
      }
    } else if (visited[v] == 1) {
      visited[u] = 2;
      return true;
    }
  }
  visited[u] = 2;
  return false;
}
bool checkSingleNode(int u) {
  if (0) printf("Checking node %d\n", u);
  fill(visited + 1, visited + n + 1, 0);
  visited[u] = 2;
  for (int i = 1; i <= n; i++) {
    if (!visited[i]) {
      if (dfsCheckCycleExistence(i)) {
        return true;
      }
    }
  }
  return false;
}
void solve() {
  for (int i = 1; i <= n; i++) {
    if (indexOnCycle[i] != 0 && checkSingleNode(i)) indexOnCycle[i] = 0;
  }
  vector<int> julcia;
  for (int i = 1; i <= n; i++) {
    if (indexOnCycle[i] != 0) {
      julcia.push_back(i);
    }
  }
  int kochamjulie = int(julcia.size());
  if (kochamjulie == 0)
    puts("-1");
  else
    printf("%d\n", julcia[0]);
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    edgeall[i] = pair<int, int>(u, v);
  }
  sort(edgeall + 1, edgeall + m + 1);
  for (int i = 1; i <= m; i++)
    if (edgeall[i] != edgeall[i - 1]) {
      int u = edgeall[i].first;
      int v = edgeall[i].second;
      out[u].push_back(v);
    }
  for (int i = 1; i <= n; i++) {
    if (!visited[i] && cycleLength == 0) {
      cycle.clear();
      dfsFindAnyCycle(i);
    }
  }
  if (cycleLength == 0) {
    printf("-1\n");
    return 0;
  }
  if (0) printf("Cycle found (%d):\n", cycleLength);
  for (int i = 0; i < int(cycle.size()); i++) {
    if (0) printf("%d\n", cycle[i]);
    indexOnCycle[cycle[i]] = i + 1;
    alias[cycle[i]] = i + 1;
  }
  lastResult = tryCycle();
  solve();
  return 0;
}
