#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
deque<int> dq, sum;
bool flag;
vector<int> v[N];
int dep[N], vis[N];
int lca[N], low[N];
stack<int> stk;
int cnt = 0;
void dfs(int u) {
  vis[u] = 1;
  lca[u] = u;
  low[u] = dep[u];
  if (!flag) stk.push(u);
  for (int i = 0; i < v[u].size(); i++) {
    int x = v[u][i];
    if (!vis[x]) {
      dep[x] = dep[u] + 1;
      dfs(x);
      if (low[x] < low[u]) {
        low[u] = low[x];
        lca[u] = lca[x];
      }
    } else if (vis[x] == 1) {
      if (!flag) {
        while (stk.top() != x) {
          dq.push_front(stk.top());
          sum.push_front(0);
          stk.pop();
        }
        dq.push_front(x);
        sum.push_front(0);
        flag = true;
      } else {
        while (!dq.empty() && vis[dq.back()] == 2)
          dq.pop_back(), sum.pop_back();
        while (!dq.empty() && dep[dq[0]] < dep[x]) {
          if (dq.size() > 1) sum[1] += sum[0];
          dq.pop_front();
          sum.pop_front();
        }
      }
      if (dep[x] < low[u]) {
        low[u] = dep[x];
        lca[u] = x;
      }
    } else if (vis[x] == 2) {
      if (vis[lca[x]] == 1 && dq.size()) {
        int lt = 0, rt = dq.size() - 1, mid, pos = dq.size();
        while (lt <= rt) {
          mid = (lt + rt) >> 1;
          if (vis[dq[mid]] == 2)
            pos = mid, rt = mid - 1;
          else
            lt = mid + 1;
        }
        if (pos < dq.size() && dq[pos] == u) pos++;
        if (pos < dq.size()) {
          sum[pos]--;
        }
        lt = 0, rt = dq.size() - 1, pos = dq.size();
        while (lt <= rt) {
          mid = (lt + rt) >> 1;
          if (dep[dq[mid]] >= dep[x])
            pos = mid, rt = mid - 1;
          else
            lt = mid + 1;
        }
        if (pos < dq.size()) sum[pos]++;
      }
      if (low[x] < low[u]) {
        low[u] = low[x];
        lca[u] = lca[x];
      }
    }
  }
  if (!flag) stk.pop();
  vis[u] = 2;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  while (m--) {
    int x, y;
    scanf("%d%d", &x, &y);
    v[x].push_back(y);
  }
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) dfs(i);
  }
  for (int i = 0, pre = 0; i < sum.size(); i++) {
    pre += sum[i];
    if (pre >= 0) {
      printf("%d\n", dq[i]);
      return 0;
    }
  }
  printf("-1\n");
  return 0;
}
