#include <bits/stdc++.h>
using namespace std;
int a[100004], b[100004], d[100004], f[100004];
int main() {
  int n, m, i, k = 0, l, r;
  scanf("%d", &n);
  scanf("%d", &m);
  a[0] = -1;
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] != a[i - 1]) d[++k] = a[i];
    b[i] = k;
  }
  f[1] = 0;
  for (i = 2; i < k; i++)
    if (d[i] < d[i - 1] && d[i] < d[i + 1])
      f[i] = f[i - 1] + 1;
    else
      f[i] = f[i - 1];
  f[k] = f[k - 1];
  for (i = 1; i <= m; i++) {
    scanf("%d", &l);
    scanf("%d", &r);
    l = b[l];
    r = b[r];
    if (l == r || f[r - 1] == f[l])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
