#include using namespace std; void fast_io() { ios::sync_with_stdio(false); std::cin.tie(nullptr); } bool debug = false; vector cnt; int query(int x) { cout << "? " << x << endl; if (debug) { return cnt[x - 1]; } else { int c; cin >> c; return c; } } int main() { fast_io(); int n; cin >> n; if (debug) { cnt.resize(n); uniform_int_distribution dist(1, n - 1); random_device rd; mt19937 mt(rd()); for (int i = 0; i < n; i++) { cnt[i] = dist(mt); } sort(cnt.begin(), cnt.end()); } int l = 1, r = n; int lcnt = query(l); int rcnt = query(r); for (int i = 0; i < 8; i++) { if (l + 1 == r) { int c = query(l); continue; } int mid = (l + r) / 2; int c = query(mid); if (mid - l > c - lcnt) { r = mid; rcnt = c; } else { l = mid; lcnt = c; } } if (debug) { assert(cnt[l - 1] == cnt[r - 1]); } cout << "Yes " << l << " " << r << endl; }