#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 t = 1; for (; t--;) { int n; if (debug) { n = 11; } else { 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); //[l, 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 (c - lcnt < mid - l) { r = mid; rcnt = c; } else { l = mid; lcnt = c; } assert(rcnt - lcnt < r - l); } assert(lcnt == rcnt); cout << "Yes " << l << " " << r << endl; if (debug) { if (cnt[l - 1] != cnt[r - 1]) { for (int i = 0; i < n; i++) { cout << cnt[i] << " "; } cout << endl; assert(cnt[l - 1] == cnt[r - 1]); } } } }