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

#include <iostream>
#include <algorithm>
#include <vector>
typedef long long llong;
const int maxn = 100000 + 10;

std::vector < int > v;
int ors[maxn], n, q;
int a[maxn];
void solve()
{
    int l, r;
    for (int query = 1 ; query <= q ; ++query)
    {
        std::cin >> l >> r;
        if (l == r)
        {
            std::cout << "No\n";
            return;
        }

        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";
    }
}

void read()
{
    std::cin >> n >> q;
    for (int i = 1 ; i <= n ; ++i) std::cin >> a[i];
}

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

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

    return 0;
}