#include <bits/stdc++.h>
using namespace std;
long long int n, q, a[200005], dp[200005];
vector<pair<long long int, long long int> > v;
long long int ok(long long int x, long long int y) {
  if (x <= y)
    return 0;
  else
    return 1;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long int i, j, k, nb, x1, x2, x3, sum = 0, l, r, ok = 1, z = 100000,
                                         x = 0;
  cin >> n >> q;
  for (i = 1; i <= n; i++) cin >> a[i];
  j = 1;
  i = 2;
  k = 3;
  memset(dp, -1, sizeof(dp));
  if (n >= 3)
    while (i <= n && j <= n && k <= n) {
      x1 = a[j];
      while (i <= n && j <= n && a[i] == a[j]) {
        i++;
        j++;
      }
      if (i <= n) x2 = a[i];
      k = i + 1;
      while (k <= n && i <= n && a[k] == a[i]) {
        k++;
        i++;
      }
      if (k <= n) x3 = a[k];
      if (x1 > x2 && x2 < x3 && j <= n && k <= n) {
        dp[k] = j;
      }
      j = i;
      i++;
      k++;
    }
  for (i = 2; i <= n; i++) dp[i] = max(dp[i], dp[i - 1]);
  while (q--) {
    ok = 1;
    cin >> l >> r;
    if (n <= 2 || (r - l <= 1)) {
      cout << "Yes\n";
      continue;
    }
    x = 0;
    if (dp[r] >= l) ok = 0;
    if (ok)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
