#include <bits/stdc++.h>
using namespace std;
int n;
int m;
vector<int> v[100002];
bool vis[100002];
int ord[100002];
int od;
int linkk[100002];
vector<int> tmp;
int belong[100002];
int be;
vector<int> ls[100002];
inline void tar(int b, int pr = -1) {
  vis[b] = true;
  ord[b] = linkk[b] = od;
  od++;
  int curr = tmp.size();
  tmp.push_back(b);
  for (int go : v[b]) {
    if (vis[go] == false) {
      tar(go, b);
      linkk[b] = min(linkk[b], linkk[go]);
    } else {
      if (belong[go] == -1) linkk[b] = min(linkk[b], ord[go]);
    }
  }
  if (linkk[b] == ord[b]) {
    while (curr != tmp.size()) {
      belong[tmp.back()] = be;
      ls[be].push_back(tmp.back());
      tmp.pop_back();
    }
    be++;
  }
}
set<int> g[100002];
vector<pair<int, int> > ed;
int deg[100002];
queue<int> q;
void miss(int b) {
  for (int el : g[b]) {
    deg[el]--;
    if (deg[el] == 0) {
      q.push(el);
    }
  }
  g[b].clear();
}
int query(int a, int b) {
  printf("? %d %d\n", a + 1, b + 1);
  fflush(stdout);
  int ret;
  scanf("%d", &ret);
  return ret;
}
int main() {
  memset(belong, -1, sizeof(belong));
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--;
    b--;
    v[a].push_back(b);
    ed.push_back(make_pair(a, b));
  }
  for (int i = 0; i < n; i++) {
    if (vis[i] == false) tar(i);
    if (tmp.size())
      while (true)
        ;
  }
  for (int i = 0; i < n; i++) {
    if (belong[i] == -1)
      while (true)
        ;
  }
  for (int i = 0; i < m; i++) {
    if (belong[ed[i].first] == belong[ed[i].second]) continue;
    g[belong[ed[i].first]].insert(belong[ed[i].second]);
  }
  cerr << "connect " << be << endl;
  for (int i = 0; i < be; i++) {
    for (int el : g[i]) {
      deg[el]++;
    }
  }
  for (int i = 0; i < be; i++) {
    if (deg[i] == 0) {
      q.push(i);
    }
  }
  int tp = q.front();
  q.pop();
  while (!q.empty()) {
    int R = q.front();
    q.pop();
    if (query(ls[tp].back(), ls[R].back())) {
      ls[R].pop_back();
    } else {
      ls[tp].pop_back();
      swap(tp, R);
    }
    if (ls[R].size()) {
      q.push(R);
    } else {
      miss(R);
    }
  }
  cout << "! " << ls[tp].back() + 1 << endl;
  return 0;
}
