#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
vector<int> v[N], vv[N], cur;
int deg[N];
bool vis[N], ins[N];
int n, m;
inline bool query(int x, int y) {
  cout << "? " << x << ' ' << y << endl;
  int z;
  cin >> z;
  return z;
}
void tarjan(int pos) {
  vis[pos] = ins[pos] = 1;
  for (auto &i : v[pos]) {
    if (!ins[i]) vv[pos].push_back(i), ++deg[i];
    if (!vis[i]) tarjan(i);
  }
  ins[pos] = 0;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  int t1, t2;
  for (int i = 1; i <= m; i++) cin >> t1 >> t2, v[t1].push_back(t2);
  for (int i = 1; i <= n; i++)
    if (!vis[i]) tarjan(i);
  for (int i = 1; i <= n; i++)
    if (!deg[i]) cur.push_back(i);
  while (cur.size() > 1) {
    t1 = cur.back();
    cur.pop_back();
    t2 = cur.back();
    cur.pop_back();
    if (!query(t1, t2)) swap(t1, t2);
    cur.push_back(t1);
    for (auto &i : vv[t2])
      if (!--deg[i]) cur.push_back(i);
  }
  cout << "! " << cur[0] << endl;
  return 0;
}
