#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int input[n];
  for (int i = 0; i < n; i++) cin >> input[i];
  int inc[n], dec[n];
  inc[n - 1] = n - 1;
  dec[0] = 0;
  for (int i = n - 2; i >= 0; i--)
    inc[i] = input[i] <= input[i + 1] ? inc[i + 1] : i;
  for (int i = 1; i < n; i++)
    dec[i] = input[i] <= input[i - 1] ? dec[i - 1] : i;
  for (int i = 0; i < m; i++) {
    int l, r;
    cin >> l >> r;
    if (inc[l - 1] >= dec[r - 1])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
