#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &num) {
  T x = 0, f = 1;
  char ch = getchar();
  for (; ch > '9' || ch < '0'; ch = getchar())
    if (ch == '-') f = -1;
  for (; ch <= '9' && ch >= '0'; ch = getchar())
    x = (x << 3) + (x << 1) + (ch ^ '0');
  num = x * f;
}
int n, m, in[1000005], q[1000005], top;
bool vis[1000005], instk[1000005];
int head[1000005], pre[1000005 << 1], to[1000005 << 1], sz;
vector<int> e[1000005];
inline void addedge(int u, int v) {
  pre[++sz] = head[u];
  head[u] = sz;
  to[sz] = v;
}
void dfs(int x) {
  vis[x] = instk[x] = 1;
  for (int i = head[x]; i; i = pre[i]) {
    int y = to[i];
    if (!instk[y]) e[x].push_back(y), ++in[y];
    if (!vis[y]) dfs(y);
  }
  instk[x] = 0;
}
inline int Ask(int u, int v) {
  printf("? %d %d\n", u, v);
  fflush(stdout);
  int ret = 0;
  read(ret);
  return ret;
}
int main() {
  read(n);
  read(m);
  for (int i = 1, u, v; i <= m; i++) {
    read(u);
    read(v);
    addedge(u, v);
  }
  for (int i = 1; i <= n; i++)
    if (!vis[i]) dfs(i);
  for (int i = 1; i <= n; i++)
    if (!in[i]) q[++top] = i;
  while (top > 1) {
    int u = q[top--], v = q[top--];
    if (!Ask(u, v)) swap(u, v);
    q[++top] = u;
    for (auto w : e[v])
      if (!(--in[w])) q[++top] = w;
  }
  printf("! %d\n", q[1]);
  fflush(stdout);
  return 0;
}
