#include <algorithm>
#include <iostream>
#include <vector>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#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< pair<int, int> > v;
    for (int i = 1; i <= n; ++ i)
    {
        v.push_back(make_pair(a[i], i));
    }

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

    while (q--)
    {
        int l, r;
        cin >> l >> r;

        int Or = 0, pos = 1;
        pref[0] = (1ll << 30);
        for (int i = 0; i < n; ++ i)
        {
            if (l <= v[i].second and v[i].second <= r)
            {
                Or |= v[i].first;
                pref[pos++] = Or;
            }
        }

        pos = r - l + 1;
        bool flag = false;
        int And = (1 << 30) - 1;
        for (int i = n - 1; i >= 0; -- i)
        {
            if (l <= v[i].second and v[i].second <= r)
            {
                And &= v[i].first;
                if (And == pref[-- pos])
                {
                    flag = true;
                    break;
                }
            }
        }

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

    return 0;
}
