#include <bits/stdc++.h>
template <typename T>
inline void read(T& x) {
  char cu = getchar();
  x = 0;
  bool fla = 0;
  while (!isdigit(cu)) {
    if (cu == '-') fla = 1;
    cu = getchar();
  }
  while (isdigit(cu)) x = x * 10 + cu - '0', cu = getchar();
  if (fla) x = -x;
}
template <typename T>
inline void printe(const T x) {
  if (x >= 10) printe(x / 10);
  putchar(x % 10 + '0');
}
template <typename T>
inline void print(const T x) {
  if (x < 0)
    putchar('-'), printe(-x);
  else
    printe(x);
}
template <typename T>
inline T min(const T a, const T b) {
  return a < b ? a : b;
}
template <typename T>
inline T max(const T a, const T b) {
  return a > b ? a : b;
}
const int maxn = 100001;
int n, m, ip;
std::vector<int> E[maxn], M[maxn];
bool vis[maxn], in[maxn];
int d[maxn];
void dfs(const int u) {
  vis[u] = in[u] = 1;
  for (std::vector<int>::iterator Pos = E[u].begin(); Pos != E[u].end();
       Pos++) {
    if (!in[*Pos]) M[u].push_back(*Pos), d[*Pos]++;
    if (!vis[*Pos]) dfs(*Pos);
  }
  in[u] = 0;
}
int Q[maxn], top;
int query(int x, int y) {
  printf("? %d %d\n", x, y), fflush(stdout);
  int z;
  scanf("%d", &z);
  return z;
}
void ans(int x) { printf("! %d\n", x), fflush(stdout); }
int main() {
  scanf("%d%d", &n, &m);
  for (register int i = 1; i <= m; i++) {
    int u, v;
    read(u), read(v);
    E[u].push_back(v);
  }
  for (register int i = 1; i <= n; i++)
    if (!vis[i]) dfs(i);
  for (register int i = 1; i <= n; i++)
    if (!d[i]) Q[++top] = i;
  ip = Q[1];
  for (register int i = 2; i <= top; i++) {
    int u = Q[i];
    if (!query(ip, u)) std::swap(ip, u);
    for (std::vector<int>::iterator Pos = M[u].begin(); Pos != M[u].end();
         Pos++)
      if (--d[*Pos] == 0) Q[++top] = *Pos;
  }
  ans(ip);
  return 0;
}
