#include<bits/stdc++.h>
#include<vector>
#define ll long long
#define ii int
using namespace std;
const ll lim = 1e6+5;
ii n, m,f[lim];
int main()
{
cin>>n>>m;
vector<ii> a(n+1);
for(ii i = 1; i <= n;i++){
cin>>a[i];
}
ll t=0,d=1;
for(ii i=1;i<=n;i++)
{
if(t==0)
{
if(a[i]>=a[i-1]) f[i]=d;
else
{
t=1;
f[i]=d;
}
}
else
{
if(a[i]>a[i-1])
{
t=0;
d++;
f[i]=d;
}
else f[i]=d;
}
}
while(m--)
{
ii x,y;
cin>>x>>y;
if(f[x]==f[y]) cout<<"Yes\n";
else cout<<"No\n";
}
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2luY2x1ZGU8dmVjdG9yPgojZGVmaW5lIGxsIGxvbmcgbG9uZwojZGVmaW5lIGlpIGludAp1c2luZyBuYW1lc3BhY2Ugc3RkOwpjb25zdCBsbCBsaW0gPSAxZTYrNTsKaWkgbiwgbSxmW2xpbV07CmludCBtYWluKCkKewogICAgY2luPj5uPj5tOwogICAgdmVjdG9yPGlpPiBhKG4rMSk7CiAgICBmb3IoaWkgaSA9IDE7IGkgPD0gbjtpKyspewogICAgICAgIGNpbj4+YVtpXTsKICAgIH0KICAgIGxsIHQ9MCxkPTE7CiAgICBmb3IoaWkgaT0xO2k8PW47aSsrKQogICAgewogICAgICAgIGlmKHQ9PTApCiAgICAgICAgewogICAgICAgICAgICBpZihhW2ldPj1hW2ktMV0pIGZbaV09ZDsKICAgICAgICAgICAgZWxzZQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICB0PTE7CiAgICAgICAgICAgICAgICBmW2ldPWQ7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWxzZQogICAgICAgIHsKICAgICAgICAgICAgaWYoYVtpXT5hW2ktMV0pCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIHQ9MDsKICAgICAgICAgICAgICAgIGQrKzsKICAgICAgICAgICAgICAgIGZbaV09ZDsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIGZbaV09ZDsKICAgICAgICB9CiAgICB9CiAgICB3aGlsZShtLS0pCiAgICB7CiAgICAgICAgaWkgeCx5OwogICAgICAgIGNpbj4+eD4+eTsKICAgICAgICBpZihmW3hdPT1mW3ldKSBjb3V0PDwiWWVzXG4iOwogICAgICAgIGVsc2UgY291dDw8Ik5vXG4iOwogICAgfQp9IA==