#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1e5 + 10;
long long n, m;
vector<long long> g[MAXN], rev_g[MAXN], gr[MAXN];
vector<pair<long long, long long> > ed;
vector<long long> order;
bool used[MAXN];
long long color[MAXN], sz[MAXN];
vector<long long> colors[MAXN], good;
long long query(long long u, long long v) {
  cout << "? " << u + 1 << " " << v + 1 << endl;
  long long q;
  cin >> q;
  return q;
}
void out(long long ans) {
  cout << "! " << ans + 1 << endl;
  exit(0);
}
void read() {
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    long long u, v;
    cin >> u >> v;
    u--;
    v--;
    ed.push_back({u, v});
    g[u].push_back(v);
    rev_g[v].push_back(u);
  }
}
void dfs_order(long long v) {
  used[v] = true;
  for (auto i : g[v])
    if (!used[i]) dfs_order(i);
  order.push_back(v);
}
void dfs_color(long long v, long long c) {
  color[v] = c;
  for (auto i : rev_g[v])
    if (!color[i]) dfs_color(i, c);
}
void clear() {
  for (long long i = 0; i < n; i++) used[i] = false;
}
void run() {
  for (long long i = 0; i < n; i++)
    if (!used[i]) dfs_order(i);
  clear();
  reverse(order.begin(), order.end());
  long long col = 1;
  for (auto i : order)
    if (!color[i]) dfs_color(i, col++);
  for (auto i : ed) {
    long long u = color[i.first] - 1, v = color[i.second] - 1;
    if (u != v) {
      gr[u].push_back(v);
      sz[v]++;
    }
  }
  col--;
  for (long long i = 0; i < n; i++) colors[color[i] - 1].push_back(i);
  for (long long i = 0; i < col; i++)
    if (sz[i] == 0) good.push_back(i);
  long long help_root = good.back();
  good.pop_back();
  long long root = colors[help_root].back();
  colors[help_root].pop_back();
  while (!good.empty()) {
    long long v = good.back();
    good.pop_back();
    while (!colors[v].empty()) {
      long long u = colors[v].back();
      colors[v].pop_back();
      long long q = query(root, u);
      if (q == 0) {
        swap(u, root);
        swap(v, help_root);
      }
    }
    for (auto i : gr[v]) {
      sz[i]--;
      if (sz[i] == 0) good.push_back(i);
    }
  }
  out(root);
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  read();
  run();
  return 0;
}
