#include <bits/stdc++.h>
using namespace std;
int const N = 100000;
int in[N + 1], pa[N + 1];
pair<int, int> ed[N];
vector<int> g[N + 1], gi[N + 1], gr[N + 1];
bool vis[N + 1];
bool ask(int a, int b) {
  printf("? %d %d\n", a, b);
  fflush(stdout);
  int an;
  scanf("%d", &an);
  return an;
}
stack<int> st;
void pl(int v) {
  if (vis[v]) return;
  vis[v] = true;
  for (int &u : g[v]) pl(u);
  st.push(v);
}
void go(int v, int b) {
  if (pa[v]) return;
  pa[v] = b;
  gr[b].push_back(v);
  for (int &u : gi[v]) go(u, b);
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < (int)(m); ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    ed[i] = make_pair(a, b);
    g[a].push_back(b);
    gi[b].push_back(a);
  }
  for (int i = 1; i < (int)(n + 1); ++i) pl(i);
  while (!st.empty()) go(st.top(), st.top()), st.pop();
  for (int i = 1; i < (int)(n + 1); ++i) g[i].clear();
  for (int i = 0; i < (int)(m); ++i) {
    int a = pa[ed[i].first], b = pa[ed[i].second];
    if (a != b) {
      g[a].push_back(b);
      ++in[b];
    }
  }
  stack<int> st;
  for (int i = 1; i < (int)(n + 1); ++i)
    if (pa[i] == i && in[i] == 0) st.push(i);
  int an = st.top();
  st.pop();
  while (!st.empty()) {
    int gc = st.top();
    st.pop();
    if (ask(gr[gc].back(), gr[an].back())) swap(an, gc);
    gr[gc].pop_back();
    if (gr[gc].empty()) {
      for (int &u : g[gc])
        if (--in[u] == 0) st.push(u);
    } else
      st.push(gc);
  }
  printf("! %d\n", gr[an].back());
}
