#include <iostream>
#include <cmath>
#define ll long long
#define endl "\n"
using namespace std;

const ll maxn = 1e5+1;
ll n,q,i,a[maxn],l,r;

int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
    cin >> n >> q;
    for(i=0;i<n;i++){
        cin >> a[i];
    }
    for(i=0;i<q;i++){
        cin >> l >> r;
        l--;
        r--;
        bool nameri=false;
        for(ll dvoi=1;dvoi<pow(2,r-l+1);dvoi++){
            ll mor=-1,mand=-1;
            //cout << dvoi << endl;
            ll copydvoi=dvoi,br=0;
            //cout << dvoi << endl;

            while(copydvoi>0){
                if(copydvoi%2==1){
                //cout << r-br << " r-br " << a[r-br] << endl;
                    /*if(dvoi==7){
                        cout << "and with " << a[r-br] << endl;
                    }*/
                    if(mand==-1){
                        mand=a[r-br];
                    }else{
                        mand=mand&a[r-br];
                    }
                }
                copydvoi/=2;
                br++;
            }
            copydvoi=pow(2,r-l+1)-1-dvoi;
            //cout << copydvoi << " copy " << endl;
            br=0;
            while(copydvoi>0){
                if(copydvoi%2==1){
                    if(dvoi==2){
                        //cout << "or with " << a[r-br] << endl;
                    }
                    if(mor==-1){
                        mor=a[r-br];
                    }else{
                        mor=mor|a[r-br];
                    }
                    if(mor>mand){
                        break;
                    }
                }
                copydvoi/=2;
                br++;
            }
            //cout << mor << " " << mand << " "<< dvoi << endl;
            if(mand==mor){
                //cout << dvoi << " dvoichen " << endl;
                //cout << l << " " << r << " " << mand << endl;
                cout << "Yes" << endl;
                nameri=true;
                break;
            }
        }
        if(!nameri){
            cout << "No" << endl;
        }
    }
return 0;
}

