#include <bits/stdc++.h>
using namespace std;
const int maxn = 100001;
vector<int> adj[maxn];
vector<int> dag[maxn];
int prv[maxn], low[maxn];
int bel[maxn], st[maxn], en[maxn];
int ind[maxn];
int n, m;
void dfs(int u);
int cal(const vector<int> &q);
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    adj[u].push_back(v);
  }
  for (int i = 1; i <= n; i++) {
    if (!bel[i]) dfs(i);
  }
  for (int u = 1; u <= n; u++) {
    for (int i = 0; i < adj[u].size(); i++) {
      int v = adj[u][i];
      if (bel[u] == bel[v]) continue;
      dag[en[bel[u]]].push_back(st[bel[v]]);
    }
  }
  for (int u = 1; u <= n; u++) {
    for (int i = 0; i < dag[u].size(); i++) {
      ind[dag[u][i]]++;
    }
  }
  vector<int> q;
  for (int i = 1; i <= n; i++) {
    if (ind[i] == 0) q.push_back(i);
  }
  while (q.size() > 1) {
    int u = cal(q);
    vector<int> nq;
    nq.push_back(u);
    for (int i = 0; i < q.size(); i++) {
      int cur = q[i];
      if (cur == u) continue;
      for (int i = 0; i < dag[cur].size(); i++) {
        int v = dag[cur][i];
        if (!(--ind[v])) nq.push_back(v);
      }
    }
    q = nq;
  }
  printf("! %d\n", q[0]);
  return 0;
}
int stk[maxn];
bool in_stk[maxn];
int top;
int cnt;
void dfs(int u) {
  static int t = 0;
  prv[u] = low[u] = ++t;
  stk[++top] = u;
  in_stk[u] = 1;
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i];
    if (!prv[v]) {
      dfs(v);
      low[u] = min(low[u], low[v]);
    } else if (in_stk[v])
      low[u] = min(low[u], prv[v]);
  }
  if (prv[u] == low[u]) {
    cnt++;
    st[cnt] = stk[top];
    while (stk[top] != u) {
      dag[stk[top]].push_back(stk[top - 1]);
      bel[stk[top]] = cnt;
      in_stk[stk[top]] = 0;
      top--;
    }
    bel[u] = cnt;
    in_stk[u] = 0;
    top--;
    en[cnt] = u;
  }
}
int cal(const vector<int> &q) {
  int ans = q[0];
  for (int i = 1; i < q.size(); i++) {
    int u = q[i];
    printf("? %d %d\n", ans, u);
    fflush(stdout);
    int cur;
    scanf("%d", &cur);
    if (cur == -1) exit(0);
    if (cur == 0) ans = u;
  }
  return ans;
}
