#include <bits/stdc++.h>
using namespace std;
class Solution {
 public:
  Solution(int size, vector<pair<int, int>> &edges)
      : n(size),
        graph(n),
        time(n, 0),
        clock(0),
        onStack(n, false),
        pos(n, -1),
        far(n, -1) {
    for (auto &p : edges) {
      auto u = p.first;
      auto v = p.second;
      graph[u].push_back(v);
    }
  }
  int search() {
    if (!hasCycle(-1)) {
      return -1;
    }
    for (int i = 0; i < cycle.size(); ++i) {
      pos[cycle[i]] = i;
    }
    int res = calc();
    if (res == -1) {
      return -1;
    }
    res = cycle[res];
    if (hasCycle(res)) {
      return -1;
    }
    return res;
  }

 private:
  int n;
  int clock;
  vector<vector<int>> graph;
  vector<int> cycle;
  vector<int> time;
  vector<bool> onStack;
  vector<int> pos;
  vector<int> far;
  bool dfs(int u, int skip) {
    if (time[u] == clock) {
      return false;
    }
    time[u] = clock;
    onStack[u] = true;
    cycle.push_back(u);
    for (auto v : graph[u]) {
      if (v == skip) {
        continue;
      }
      if (onStack[v]) {
        reverse(cycle.begin(), cycle.end());
        while (cycle.back() != v) {
          cycle.pop_back();
        }
        reverse(cycle.begin(), cycle.end());
        return true;
      } else if (time[v] < clock) {
        if (dfs(v, skip)) {
          return true;
        }
      }
    }
    cycle.pop_back();
    onStack[u] = false;
    return false;
  }
  bool hasCycle(int u) {
    cycle.clear();
    ++clock;
    fill(onStack.begin(), onStack.end(), false);
    for (int i = 0; i < n; ++i) {
      if (dfs(i, u)) {
        return true;
      }
    }
    return false;
  }
  int dis(int u, int v) {
    if (u == v) {
      return cycle.size();
    }
    return ((pos[v] - pos[u]) + cycle.size()) % cycle.size();
  }
  void dfs2(int u, int rt) {
    if (time[u] == clock) {
      return;
    }
    time[u] = clock;
    for (auto v : graph[u]) {
      if (isCycleEdge(u, v)) {
        continue;
      }
      if (pos[v] != -1) {
        if (far[u] == -1 || dis(rt, far[u]) < dis(rt, v)) {
          far[u] = v;
        }
      } else {
        dfs2(v, rt);
        if (far[v] != -1 &&
            (far[u] == -1 || dis(rt, far[u]) < dis(rt, far[v]))) {
          far[u] = far[v];
        }
      }
    }
  }
  bool isCycleEdge(int u, int v) {
    if (pos[u] != -1 && pos[v] != -1 && (pos[u] + 1) % cycle.size() == pos[v]) {
      return true;
    }
    return false;
  }
  int calc() {
    ++clock;
    for (auto rt : cycle) {
      dfs2(rt, rt);
    }
    vector<int> sums(cycle.size(), 0);
    for (auto u : cycle) {
      if (far[u] == -1) {
        continue;
      }
      int l = pos[far[u]];
      int r = (pos[u] + 1) % cycle.size();
      ++sums[l];
      --sums[r];
      if (l >= r) {
        ++sums[0];
      }
    }
    for (int i = 1; i < cycle.size(); ++i) {
      sums[i] += sums[i - 1];
    }
    int mx = -1;
    int res = -1;
    for (int i = 0; i < cycle.size(); ++i) {
      if (sums[i] > mx) {
        mx = sums[i];
        res = i;
      }
    }
    return res;
  }
};
int main(int argc, char **argv) {
  int n, m;
  scanf("%d%d", &n, &m);
  vector<pair<int, int>> edges;
  edges.reserve(m);
  for (int i = 0, u = 0, v = 0; i < m; ++i) {
    scanf("%d%d", &u, &v);
    edges.emplace_back(u - 1, v - 1);
  }
  Solution sol(n, edges);
  auto res = sol.search();
  if (res == -1) {
    printf("-1\n");
  } else {
    printf("%d\n", res + 1);
  }
  return 0;
}
