#include <algorithm>
#include <iostream>
#include <vector>
#define endl '\n'
using namespace std;

const int MAXN = 100000;

int a[MAXN + 5];
int pref[MAXN + 5];

int main()
{
    ios :: sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);

    int n, q;
    cin >> n >> q;

    for (int i = 1; i <= n; ++ i)
    {
        cin >> a[i];
    }

    vector<int> v;
    for (int i = 1; i <= q; ++ i)
    {
        int l, r;
        cin >> l >> r;

        v.clear();
        //v.reserve(r - l + 1);

        for (int j = l; j <= r; ++ j)
        {
            v.push_back(a[j]);
        }

        sort(v.begin(), v.end());

        int Or = 0;
        for (int i = 0; i < v.size(); ++ i)
        {
            Or |= v[i];
            pref[i] = Or;
        }

        bool flag = false;
        int And = (1 << 30) - 1;
        for (int i = v.size() - 1; i > 0; -- i)
        {
            And &= v[i];
            if (And == pref[i - 1]) flag = true;
        }

        if (flag) cout << "Yes" << endl;
        else cout << "No" << endl;
    }

    return 0;
}
