#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long sum = 0, f = 0;
  char c = getchar();
  while (!isdigit(c)) f |= (c == '-'), c = getchar();
  while (isdigit(c)) sum = (sum << 1) + (sum << 3) + (c ^ 48), c = getchar();
  return f ? -sum : sum;
}
const int N = 100010;
int n, m, vis[N], insta[N], in[N];
vector<int> G[N], E[N];
inline int query(int x, int y) {
  printf("? %d %d\n", x, y);
  fflush(stdout);
  return read();
}
void dfs(int u) {
  vis[u] = insta[u] = 1;
  for (register int i = (0); i <= ((int)E[u].size() - 1); i++) {
    int v = E[u][i];
    if (!insta[v]) in[v]++, G[u].push_back(v);
    if (!vis[v]) dfs(v);
  }
  insta[u] = 0;
}
inline void GG(int x) {
  printf("! %d\n", x);
  fflush(stdout);
}
int main() {
  n = read(), m = read();
  for (int i = 1, u, v; i <= m; i++) u = read(), v = read(), E[u].push_back(v);
  for (register int i = (1); i <= (n); i++)
    if (!vis[i]) dfs(i);
  queue<int> q;
  for (register int i = (1); i <= (n); i++)
    if (!in[i]) q.push(i);
  while (q.size() > 1) {
    int u = q.front();
    q.pop();
    int v = q.front();
    q.pop();
    int tmp = query(u, v);
    if (tmp) swap(u, v);
    q.push(v);
    for (register int i = (0); i <= ((int)G[u].size() - 1); i++) {
      v = G[u][i];
      in[v]--;
      if (!in[v]) q.push(v);
    }
  }
  GG(q.front());
}
