#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
vector<int> G[maxn], H[maxn], C[maxn];
int u, v, n, m, s[maxn], h[maxn], tp, d[maxn], cnt, bel[maxn], dfn[maxn],
    low[maxn], dfs_clock;
bool vis[maxn];
void tarjan(int u) {
  dfn[u] = low[u] = ++dfs_clock;
  vis[u] = 1;
  s[++tp] = u;
  for (int v : G[u])
    if (vis[v])
      low[u] = min(low[u], dfn[v]);
    else if (!dfn[v])
      tarjan(v), low[u] = min(low[u], low[v]);
  if (dfn[u] == low[u]) {
    ++cnt;
    vis[u] = 0;
    while (tp) {
      int x = s[tp];
      bel[x] = cnt;
      vis[x] = 0;
      --tp;
      C[cnt].push_back(x);
      if (x == u) break;
    }
  }
}
int query(int x, int y) {
  printf("? %d %d\n", x, y);
  fflush(stdout);
  int z;
  scanf("%d", &z);
  return z;
}
map<pair<int, int>, int> dsy;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = (1); i <= (m); ++i) scanf("%d%d", &u, &v), G[u].push_back(v);
  for (int i = (1); i <= (n); ++i)
    if (!dfn[i]) tarjan(i);
  for (int u = (1); u <= (n); ++u)
    for (int v : G[u])
      if ((bel[u] ^ bel[v]) && !dsy[make_pair(bel[u], bel[v])])
        H[bel[u]].push_back(bel[v]), ++d[bel[v]],
            dsy[make_pair(bel[u], bel[v])] = 1;
  tp = 0;
  for (int i = (1); i <= (cnt); ++i)
    if (!d[i]) s[++tp] = i;
  while (tp > 1) {
    int x = s[tp], y = s[tp - 1];
    tp -= 2;
    if (query(C[x][h[x]], C[y][h[y]]))
      ++h[y];
    else
      swap(x, y), ++h[y];
    s[++tp] = x;
    if (h[y] == C[y].size()) {
      for (int p : H[y]) {
        --d[p];
        if (!d[p]) s[++tp] = p;
      }
    } else
      s[++tp] = y;
  }
  int x = s[1];
  printf("! %d\n", C[x][h[x]]);
  fflush(stdout);
  return 0;
}
