// От софия до банско да гърми шампанско

#include <iostream>
#include <algorithm>
#include <vector>
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
typedef long long llong;
const int maxn = 100000 + 10;

char buff[maxn];
int buffSize = 1e5;
int buffPos = buffSize - 1;

inline void readChar()
{
    if (++buffPos == buffSize) fread(buff, buffSize, 1, stdin), buffPos = 0;
}

inline void readInt(int &x)
{
    x = 0;
    for (; '0' > buff[buffPos] || buff[buffPos] > '9'; readChar());
    for (; '0' <= buff[buffPos] && buff[buffPos] <= '9'; readChar())
        x = 10*x + buff[buffPos] -'0';
}

std::vector < int > v;
int ors[maxn], n, q;
int a[maxn];

inline void solve()
{
    int l, r;
    for (int query = 1 ; query <= q ; ++query)
    {
        readInt(l);
        readInt(r);
        if (l == r)
        {
            std::cout << "No\n";
            continue;
        }

        v.clear(); v.reserve(r-l+1);
        for (int i = l ; i <= r ; ++i) v.push_back(a[i]);
        std::sort(v.begin(), v.end());
        ors[0] = v[0];
        for (int i = 1 ; i < v.size() ; ++i) ors[i] = ors[i-1] | v[i];
        int currand = v.back();
        bool bl = 0;
        for (int i = v.size()-2 ; i >= 0 ; --i)
        {
            if (currand == ors[i])
            {
                std::cout << "Yes\n";
                bl = 1;
                break;
            }
            currand &= v[i];
        }

        if (!bl) std::cout << "No\n";
    }
}

inline void read()
{
    readInt(n);
    readInt(q);
    for (int i = 1 ; i <= n ; ++i) readInt(a[i]);
}

inline void fastIO()
{
    std::ios_base :: sync_with_stdio(0);
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
}

int main() 
{
    fastIO();
    read();
    solve();

    return 0;
}
