#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int edcnt, head[N];
struct edge {
  int to, Next;
} ed[N];
void addedge(int u, int v) {
  ed[++edcnt] = (edge){v, head[u]};
  head[u] = edcnt;
}
bool vis[N], instk[N];
int deg[N];
vector<int> vec[N];
void dfs(int u) {
  vis[u] = instk[u] = true;
  for (int i = head[u]; i; i = ed[i].Next) {
    int v = ed[i].to;
    if (!instk[v]) vec[u].push_back(v), deg[v]++;
    if (!vis[v]) dfs(v);
  }
  instk[u] = false;
}
int find(int x, int y) {
  printf("? %d %d\n", x, y), fflush(stdout);
  int ret;
  scanf("%d", &ret);
  return ret;
}
int que[N];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    addedge(u, v);
  }
  for (int i = 1; i <= n; i++)
    if (!vis[i]) dfs(i);
  int cnt = 0;
  for (int i = 1; i <= n; i++)
    if (!deg[i]) que[++cnt] = i;
  while (cnt > 1) {
    int u = que[cnt--], v = que[cnt--];
    if (!find(u, v)) swap(u, v);
    que[++cnt] = u;
    for (int i = head[v]; i; i = ed[i].Next) {
      deg[ed[i].to]--;
      if (!deg[ed[i].to]) que[++cnt] = ed[i].to;
    }
  }
  printf("! %d\n", que[1]);
  fflush(stdout);
  return 0;
}
