#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> adjlist[100005];
vector<int> maincycle;
vector<pair<int, int> > arcs;
map<int, int> positionscycle;
int visitedcycle[100005];
bool visitedcyclecycle[100005];
int visitednoncycle[100005];
int depth[100005];
int furthest[100005];
bool cyclefound;
int cycleorigin = -1;
int bgin, bgincycle;
int cyclesize;
int ans = -1;
bool fatal = false;
bool wtf = false;
void dfscycle(int node) {
  visitedcycle[node] = 1;
  for (vector<int>::iterator iter = adjlist[node].begin();
       iter != adjlist[node].end(); iter++) {
    if (visitedcycle[*iter] == 0) {
      dfscycle(*iter);
    } else if (visitedcycle[*iter] == 1) {
      cyclefound = true;
      cycleorigin = *iter;
    }
    if (cyclefound) {
      if (cycleorigin != -1) {
        if (node == cycleorigin) {
          cycleorigin = -1;
        }
        maincycle.push_back(node);
        visitedcycle[node] = 4;
      }
      return;
    }
  }
  visitedcycle[node] = 3;
}
int dfscyclecycle(int node) {
  if (visitedcyclecycle[node]) {
    return furthest[node];
  }
  visitedcyclecycle[node] = true;
  int x;
  for (vector<int>::iterator iter = adjlist[node].begin();
       iter != adjlist[node].end(); iter++) {
    if (depth[*iter] == 0) {
      x = dfscyclecycle(*iter);
    } else {
      x = *iter;
    }
    if (furthest[node] == -1 || depth[x] > depth[furthest[node]]) {
      furthest[node] = x;
    }
  }
  return furthest[node];
}
bool contains(pair<int, int> segment, int point) {
  if (segment.first < segment.second) {
    if (point >= segment.first && point <= segment.second) {
      return true;
    } else {
      return false;
    }
  } else if (segment.first > segment.second) {
    if (point >= segment.first || point <= segment.second) {
      return true;
    } else {
      return false;
    }
  } else {
    if (segment.first == point) {
      return true;
    } else {
      return false;
    }
  }
}
bool detfirst(int point1, int point2, int point3) {
  if (point2 <= point1 && point3 <= point1) {
    if (point2 == point1) {
      return true;
    } else if (point2 > point3) {
      return false;
    } else if (point2 < point3) {
      return true;
    } else {
      return true;
    }
  } else if (point2 >= point1 && point3 >= point1) {
    if (point2 > point3) {
      return false;
    } else if (point2 < point3) {
      return true;
    } else {
      return true;
    }
  } else if (point2 >= point1 && point3 <= point1) {
    return true;
  } else if (point2 <= point1 && point3 >= point1) {
    if (point2 == point3) {
      return true;
    } else {
      return false;
    }
  }
}
void findintersection() {
  int minarc = -1;
  int maxarc = -1;
  bool possible = true;
  list<pair<int, int> > segments;
  if (!arcs.empty()) {
    segments.push_back({arcs[0].first, arcs[0].second});
  } else {
    if (!maincycle.empty()) {
      ans = maincycle[0];
      visitedcycle[ans] = 5;
    }
  }
  for (vector<pair<int, int> >::iterator iter = arcs.begin();
       iter != arcs.end(); iter++) {
    for (list<pair<int, int> >::iterator iter2 = segments.begin();
         iter2 != segments.end(); iter2++) {
      if (contains((*iter2), (*iter).first) &&
          contains((*iter2), (*iter).second)) {
        if (detfirst((*iter).first, (*iter).second, (*iter2).second)) {
          if ((*iter).first != (*iter2).first ||
              (*iter).second != (*iter2).second) {
            segments.push_back({(*iter).first, (*iter).second});
            iter2 = segments.erase(iter2);
          } else {
          }
        } else {
          segments.push_back({(*iter2).first, (*iter).second});
          segments.push_back({(*iter).first, (*iter2).second});
          iter2 = segments.erase(iter2);
        }
      } else if (contains((*iter2), (*iter).first)) {
        if ((*iter).first != (*iter2).first) {
          segments.push_back({(*iter).first, (*iter2).second});
          iter2 = segments.erase(iter2);
        }
      } else if (contains((*iter2), (*iter).second)) {
        if ((*iter).second != (*iter2).second) {
          segments.push_back({(*iter2).first, (*iter).second});
          iter2 = segments.erase(iter2);
        }
      } else {
        if (contains((*iter), (*iter2).first) &&
            contains((*iter), (*iter2).second)) {
        } else {
          iter2 = segments.erase(iter2);
        }
      }
    }
  }
  int minarc2;
  if (!segments.empty()) {
    minarc2 = (*segments.begin()).first;
  } else {
    possible = false;
  }
  if (possible) {
    ans = minarc2;
    ans = maincycle[ans];
    visitedcycle[ans] = 5;
  }
}
void dfsnocycle(int node) {
  visitednoncycle[node] = 1;
  for (vector<int>::iterator iter = adjlist[node].begin();
       iter != adjlist[node].end(); iter++) {
    if (visitednoncycle[*iter] == 0 && visitedcycle[*iter] != 5) {
      dfsnocycle(*iter);
    } else if (visitednoncycle[*iter] == 1) {
      fatal = true;
    }
  }
  visitednoncycle[node] = 2;
}
int main() {
  int m;
  scanf("%i %i", &n, &m);
  int end1, end2;
  for (int i = 0; i < m; i++) {
    scanf("%i %i", &end1, &end2);
    adjlist[end1].push_back(end2);
  }
  for (int i = 1; i <= n; i++) {
    if (visitedcycle[i] == 0 && !cyclefound) {
      dfscycle(i);
    }
    furthest[i] = -1;
  }
  reverse(maincycle.begin(), maincycle.end());
  int z = 0;
  for (vector<int>::iterator iter = maincycle.begin(); iter != maincycle.end();
       iter++) {
    positionscycle.insert({*iter, z});
    depth[*iter] = z;
    z++;
  }
  cyclesize = maincycle.size();
  for (vector<int>::iterator iter = maincycle.begin(); iter != maincycle.end();
       iter++) {
    bgin = *iter;
    bgincycle = positionscycle[*iter];
    depth[*iter] += cyclesize;
    dfscyclecycle(*iter);
  }
  z = 0;
  for (vector<int>::iterator iter = maincycle.begin(); iter != maincycle.end();
       iter++) {
    if (furthest[*iter] != maincycle[(z + 1) % cyclesize]) {
      arcs.push_back({positionscycle[furthest[*iter]], z});
    }
    z++;
  }
  findintersection();
  for (int i = 1; i <= n; i++) {
    if (visitednoncycle[i] == 0 && visitedcycle[i] != 5) {
      dfsnocycle(i);
    }
  }
  if (fatal) {
    printf("-1");
    return 0;
  }
  printf("%i", ans);
  return 0;
}
