#include<iostream>
using namespace std;

long long broiChisla;
long long broiZaqvki;

long long chisla[100010];

int tekushtiChisla[100010];
int broiTekushti;

bool mojeLi(int doIndex, int ili, int 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(int otKade, int dokade){

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

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

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

    broiTekushti = 0;
    return okLiE;
}

int main(){

    cin>>broiChisla>>broiZaqvki;

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

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

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

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

    return 0;
}
