#include<iostream>
using namespace std;

long long broiChisla;
long long broiZaqvki;

long long chisla[100010];

long long tekushtiChisla[100010];
long long broiTekushti;

bool mojeLi(long long doIndex, long long ili, long long i){
    if(doIndex == 0){
        if(ili == i){
            return true;
        }else{
            return false;
        }
    }

    bool akoEVParvoto = mojeLi(doIndex - 1, ili | tekushtiChisla[doIndex], i);
    bool akoEVavVtoroto = mojeLi(doIndex - 1, ili, i & tekushtiChisla[doIndex]);

    return akoEVParvoto | akoEVavVtoroto;
}

bool stavaLi(long long otKade, long long dokade){

    /*cout<<"davat ni ";
    for(long long i = otKade; i <= dokade; i++){
        cout<<chisla[i]<<" ";
    }
    cout<<endl;*/

    for(long long i = otKade; i <= dokade; i++){
        broiTekushti++;
        tekushtiChisla[broiTekushti] = chisla[i];
    }

    bool okLiE = mojeLi(broiTekushti, 0, (long long)-1);

    broiTekushti = 0;
    return okLiE;
}

int main(){

    cin>>broiChisla>>broiZaqvki;

    for(long long i = 0; i < broiChisla; i++){
        cin>>chisla[i];
    }

    for(long long i = 0; i < broiZaqvki; i++){
        long long otKade;
        long long doKade;

        cin>>otKade>>doKade;
        otKade--;
        doKade--;

        if(stavaLi(otKade, doKade)){
            cout<<"Yes"<<endl;
        }else{
            cout<<"No"<<endl;
        }
    }

    return 0;
}
