#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> v, w;
int main() {
  cin >> n >> m;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  v.push_back(0);
  w.push_back(0);
  for (int i = 1; i < n; ++i) {
    if (a[i] < a[i - 1]) {
      v.push_back(v.back() + 1);
    } else {
      v.push_back(v.back());
    }
    if (a[i] > a[i - 1]) {
      w.push_back(w.back() + 1);
    } else {
      w.push_back(w.back());
    }
  }
  for (int i = 0; i < m; ++i) {
    int x, y;
    cin >> x >> y;
    --x, --y;
    if (v[x] == v[y] || w[x] == w[y])
      cout << "Yes" << endl;
    else {
      int p = lower_bound(v.begin(), v.end(), v[x] + 1) - v.begin();
      if (w[p] == w[y]) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    }
  }
}
