#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, m, num, ind[N], bel[N];
map<int, int> mp[N];
vector<int> g[N], nt[N], st[N];
int q[N], tl;
int df[N], low[N], dfn, stk[N], top;
void tar(int x) {
  df[x] = low[x] = ++dfn;
  stk[++top] = x;
  for (int y : g[x]) {
    if (!df[y]) {
      tar(y);
      low[x] = min(low[x], low[y]);
    } else if (!bel[y])
      low[x] = min(low[x], df[y]);
  }
  if (low[x] == df[x]) {
    num++;
    for (int tp;;) {
      tp = stk[top--];
      bel[tp] = num;
      st[num].push_back(tp);
      if (tp == x) break;
    }
  }
}
inline int ask(int x, int y) {
  cout << "? " << x << " " << y << endl;
  int re;
  cin >> re;
  return re;
}
int main() {
  int i, x, y, b;
  cin >> n >> m;
  for (i = 1; i <= m; ++i) {
    cin >> x >> y;
    g[x].push_back(y);
  }
  for (i = 1; i <= n; ++i)
    if (!df[i]) tar(i);
  for (i = 1; i <= n; ++i) {
    b = bel[i];
    for (int y : g[i])
      if (bel[y] != b && (!mp[b][bel[y]])) {
        nt[b].push_back(bel[y]);
        ind[bel[y]]++;
        mp[b][bel[y]] = 1;
      }
  }
  for (i = 1; i <= num; ++i)
    if (!ind[i]) q[++tl] = i;
  for (; tl > 1;) {
    x = st[q[1]].back();
    y = st[q[2]].back();
    if (!ask(x, y)) swap(q[2], q[1]);
    y = q[2];
    st[y].pop_back();
    if (!st[y].size()) {
      swap(q[2], q[tl]);
      --tl;
      for (int b : nt[y]) {
        ind[b]--;
        if (!ind[b]) q[++tl] = b;
      }
    }
  }
  cout << "! " << st[q[1]].back() << endl;
  return 0;
}
