#include <bits/stdc++.h>
using namespace std;
struct Digraph {
  vector<vector<int> > arcs;
  int n;
  Digraph(int n_) : arcs(n_) { n = n_; }
  void add(int i, int j) { arcs[i].push_back(j); }
  void expl(int i, vector<bool>& stk, vector<bool>& vst, Digraph& dig) const {
    vst[i] = true;
    stk[i] = true;
    for (auto& j : arcs[i]) {
      if (stk[j]) continue;
      dig.add(i, j);
      if (!vst[j]) {
        expl(j, stk, vst, dig);
      }
    }
    stk[i] = false;
  }
  Digraph reduce() const {
    Digraph ans(n);
    vector<bool> stk(n, 0);
    vector<bool> vst(n, 0);
    for (int i = 0; i < n; ++i) {
      if (!vst[i]) {
        expl(i, stk, vst, ans);
      }
    }
    return ans;
  }
};
int ask(int i, int j) {
  printf("? %d %d\n", i + 1, j + 1);
  fflush(stdout);
  int rsp;
  scanf("%d", &rsp);
  if (rsp == -1) exit(0);
  return rsp ? i : j;
}
void claim(int i) {
  printf("! %d\n", i + 1);
  fflush(stdout);
}
int main() {
  int N, M;
  scanf("%d%d", &N, &M);
  Digraph g(N);
  for (int i = 0; i < M; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    g.add(a - 1, b - 1);
  }
  Digraph h = g.reduce();
  vector<int> deg(N, 0);
  for (auto& v : h.arcs) {
    for (auto& j : v) {
      deg[j] += 1;
    }
  }
  deque<int> que;
  for (int i = 0; i < N; ++i) {
    if (!deg[i]) {
      que.push_back(i);
    }
  }
  while (que.size() > 1) {
    int u = que.front();
    int v = que.back();
    if (ask(u, v) != u) {
      swap(que.front(), que.back());
      swap(u, v);
    }
    que.pop_back();
    for (auto& j : h.arcs[v]) {
      if (--deg[j] == 0) {
        que.push_back(j);
      }
    }
  }
  claim(que.front());
  return 0;
}
