#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 50;
vector<int> E[N], G[N];
int n, m, d[N];
bool ex[N], in[N];
void dfs(int u) {
  in[u] = ex[u] = true;
  for (int v : E[u]) {
    if (!in[v]) G[u].push_back(v), ++d[v];
    if (!ex[v]) dfs(v);
  }
  in[u] = false;
}
int query(int x, int y) {
  cout << "? " << x << " " << y << endl;
  scanf("%d", &x);
  return x;
}
int main() {
  cin >> n >> m;
  for (int i = 1, u, v; i <= m; i++) scanf("%d%d", &u, &v), E[u].push_back(v);
  for (int i = 1; i <= n; i++)
    if (!ex[i]) dfs(i);
  vector<int> S;
  for (int i = 1; i <= n; i++)
    if (!d[i]) S.push_back(i);
  while (S.size() > 1) {
    int x = S[S.size() - 1], y = S[S.size() - 2];
    if (!query(x, y)) swap(x, y);
    S[S.size() - 2] = x, S.pop_back();
    for (int v : G[y])
      if (!--d[v]) S.push_back(v);
  }
  cout << "! " << S[0] << endl;
  return 0;
}
