#include<bits/stdc++.h>
#define endl '\n'

using namespace std;

int n, q;
long long a[100005];
int minch=1e9, maxch=-1;
int segm_min[400005][30];
int segm_max[400005][30];

void build_tree(int v, int le, int ri)
{
    if(le==ri)
    {
        for(int i=0; i<30; i++)
        {
            bool t=(a[le]&(1<<i));
            if(t) segm_min[v][i]=le;
            else segm_max[v][i]=le;
        }
    }
    else
    {
        int mid=(le+ri)/2;
        build_tree(2*v, le, mid);
        build_tree(2*v+1, mid+1, ri);
        for(int i=0; i<30; i++)
        {
            segm_min[v][i]=segm_min[2*v][i];
            if(segm_min[v][i]==1e9 || (segm_min[2*v+1][i]!=1e9 && (a[segm_min[2*v+1][i]]<a[segm_min[v][i]] || (a[segm_min[2*v+1][i]]==a[segm_min[v][i]] && segm_min[2*v+1][i]<segm_min[v][i])))) segm_min[v][i]=segm_min[2*v+1][i];
            segm_max[v][i]=segm_max[2*v][i];
            if(segm_max[v][i]==1e9 || (segm_max[2*v+1][i]!=1e9 && (a[segm_max[2*v+1][i]]>a[segm_max[v][i]] || (a[segm_max[2*v+1][i]]==a[segm_max[v][i]] && segm_max[2*v+1][i]>segm_max[v][i])))) segm_max[v][i]=segm_max[2*v+1][i];
        }
    }
}

int mist[30], mast[30];

void query(int v, int le, int ri, int be, int en)
{
    if(le>en || ri<be) return;
    else if(be<=le && ri<=en)
    {
        for(int i=0; i<30; i++)
        {
            if(mist[i]==1e9 || (segm_min[v][i]!=1e9 && (a[segm_min[v][i]]<a[mist[i]] || (a[segm_min[v][i]]==a[mist[i]] && segm_min[v][i]<mist[i])))) mist[i]=segm_min[v][i];
            if(mast[i]==1e9 || (segm_max[v][i]!=1e9 && (a[segm_max[v][i]]>a[mast[i]] || (a[segm_max[v][i]]==a[mast[i]] && segm_max[v][i]>mast[i])))) mast[i]=segm_max[v][i];
        }
    }
    else
    {
        int mid=(le+ri)/2;
        query(2*v, le, mid, be, en);
        query(2*v+1, mid+1, ri, be, en);
    }
}

struct point
{
    long long pos, ty;
    point() {}
    point(long long a, long long b)
    {
        pos=a;
        ty=b;
    }
};

bool cmp(point p, point q)
{
    if(p.pos==q.pos) return p.ty<q.ty;
    return p.pos<q.pos;
}

int brp=0;
point p[62];


bool pos(int be, int en)
{
    ///if(be==0 && en==4 && n==6) return 1;
    for(int j=0; j<30; j++)
    {
        mist[j]=1e9;
        mast[j]=1e9;
    }
    query(1, 0, n-1, be, en);
    brp=0;
    for(int j=0; j<30; j++)
    {
        if(mist[j]==1e9 || mast[j]==1e9) continue;
        ///cout<<mist[j]<<"  "<<mast[j]<<endl;
        if(a[mist[j]]*20000000+mist[j]>a[mast[j]]*20000000+mast[j]) swap(mist[j], mast[j]);
        p[brp]=point(a[mist[j]]*20000000+mist[j], 1);
        p[brp+1]=point(a[mast[j]]*20000000+mast[j], -1);
        brp+=2;
    }
    if(!brp) return 1;
    sort(p, p+brp, cmp);
    ///for(int i=0; i<brp; i++) cout<<"{"<<p[i].pos<<" "<<p[i].ty<<"} ";
    ///cout<<endl;
    int tt=0;
    for(int i=0; i<brp; i++)
    {
        if(i && p[i-1].pos!=p[i].pos && tt==0) return 1;
        tt+=p[i].ty;
    }
    return 0;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin>>n>>q;
    for(int i=0; i<n; i++)
    {
        cin>>a[i];
        if(a[i]>maxch) maxch=a[i];
        if(a[i]<minch) minch=a[i];
    }
    for(int i=0; i<400000; i++)
    {
        for(int j=0; j<30; j++)
        {
            segm_min[i][j]=1e9;
            segm_max[i][j]=1e9;
        }
    }
    build_tree(1, 0, n-1);
    for(int i=0; i<q; i++)
    {
        int p1, p2;
        cin>>p1>>p2;
        if(n>=2 && p2-p1>=1 && pos(p1-1, p2-1)) cout<<"Yes\n";
        else cout<<"No\n";
    }
    return 0;
}
/**
6 8
13 15 13 5 1 7
1 5
2 5
3 6
4 6
1 1
2 6
3 4

*/
