#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7, maxn = 100005, ln = 18;
inline void S(int& n) {
  n = 0;
  int ch = getchar();
  int sign = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') sign = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    n = (n << 3) + (n << 1) + ch - '0', ch = getchar();
  }
  n = n * sign;
}
const int inf = int(1e9), shift = 30, etf = mod - 1;
int n, m;
int a[maxn];
vector<int> v[maxn];
void pre() {
  int cnt = 1, flag = 0;
  v[1].push_back(cnt);
  for (int i = 2; i < n + 1; i++) {
    if (!flag) {
      if (a[i] >= a[i - 1])
        v[i].push_back(cnt);
      else {
        flag = 1;
      }
    }
    if (flag) {
      if (a[i] <= a[i - 1])
        v[i].push_back(cnt);
      else {
        flag = 0;
        cnt++;
        i--;
      }
    }
  }
  flag = 0;
  for (int i = 2; i < n; i++) {
    if (a[i] > a[i - 1]) {
      if (flag) {
        for (int j = flag; j < i; j++) {
          v[j].push_back(v[i][0]);
        }
        flag = 0;
      }
    } else if (a[i] < a[i - 1]) {
      flag = i;
    }
  }
}
int main() {
  cin >> n >> m;
  for (int i = 1; i < n + 1; i++) cin >> a[i];
  pre();
  while (m--) {
    int l, r;
    cin >> l >> r;
    if (l == r) {
      cout << "Yes\n";
      continue;
    }
    if (v[l][v[l].size() - 1] == v[r][0])
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
