#include <bits/stdc++.h>
using namespace std;
#define LL long long
const int N = 1e6 + 10;
int a[10000];
int main()
{
int n, q;
cin >> n >> q;
for(int i = 1; i <= n; i++)
{
cin >> a[i];
}
while(q--)
{
int l, r, f = 0;
cin >> l >> r;
sort(a + l + 1, a + r + 1);
for(int i = l + 1; i <= r; i++)
{
if(a[i] == a[i - 1])
{
f = 1;
break;
}
}
if(f == 0) cout << "Yes" << '\n';
else cout << "No" << '\n';
}
return 0;
}