#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long l, r, n, q, i, j;
  cin >> n >> q;
  long long A[n];
  for (i = 0; i < n; i++) cin >> A[i];
  vector<long long> low(n), hi(n);
  for (i = 1; i <= n - 2; i++) {
    if (A[i] < A[i - 1] && A[i] < A[i + 1]) low[i]++;
    if (A[i] > A[i - 1] && A[i] > A[i + 1]) hi[i]++;
  }
  for (i = 1; i < n; i++) {
    low[i] += low[i - 1];
    hi[i] += hi[i - 1];
  }
  while (q--) {
    cin >> l >> r;
    l--;
    r--;
    if (l == r || ((l + 1) == r))
      cout << "Yes\n";
    else if (A[l] > A[l + 1]) {
      if (hi[r - 1] == hi[l] && low[r - 1] == low[l])
        cout << "Yes\n";
      else
        cout << "No\n";
    } else {
      if (hi[r - 1] - hi[l] <= 1 && low[r - 1] == low[l])
        cout << "Yes\n";
      else
        cout << "No\n";
    }
  }
}
