#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< pair<int, int> > v;
    for (int i = 1; i <= n; ++ i)
    {
        v.push_back(make_pair(a[i], i));
    }

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

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

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

        pos = r - l;
        bool flag = false;
        int And = (1 << 30) - 1;
        for (int i = v.size() - 1; i >= 0 and pos > 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;
}
