func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 5000 + 20;   const int maxn = 1e5 + 20;   const int mod = 998244353;   int cnt, head[maxn], pos[maxn];   long long ksm(long long a, long long b) {     long long res = 1;     while (b) {       if (b & 1) res = (res * a) % mod;       b >>= 1, a = a * a % mod;     }     return res % mod;   }   void read(int &v) {     int k = 1;     v = 0;     int c = getchar();     while (c <  0  || c >  9 ) {       if (c ==  - ) k = 0;       c = getchar();     }     while (c >=  0  && c <=  9 )       v = (v << 3) + (v << 1) + (c - 48), c = getchar();     if (k == 0) v = -v;   }   int d[maxn], dp[maxn], a[maxn], same[maxn];   int main() {     int n, q;     read(n), read(q);     for (int i = 1; i <= n; i++) {       read(a[i]);       if (a[i] == a[i - 1]) same[i] = same[i - 1] + 1;       if (a[i] >= a[i - 1])         d[i] = 0;       else         d[i] = 1;     }     dp[0] = 0;     for (int i = 1; i <= n; i++) dp[i] = dp[i - 1] + d[i];     while (q--) {       int l, r;       read(l), read(r);       if (dp[r] - dp[l] == 0)         puts( Yes );       else if (dp[r] - dp[l] == r - l)         puts( Yes );       else {         int x = dp[r] - dp[l];         r = r - same[r];         if (dp[r] - dp[r - x] == x)           puts( Yes );         else           puts( No );       }     }     return 0;   }   