#include<bits/stdc++.h>
#define int long long
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define ld(a) while(a--)
#define tci(v,i) for(auto i=v.begin();i!=v.end();i++)
#define tcf(v,i) for(auto i : v)
#define all(v) v.begin(),v.end()
#define rep(i,start,lim) for(long long (i)=(start);i<(lim);i++)
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define osit ostream_iterator
#define INF 0x3f3f3f3f
#define LLINF 1000111000111000111LL
#define PI 3.14159265358979323
#define endl '\n'
#define trace1(x) cerr<<#x<<": "<<x<<endl
#define trace2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
const int N=1000006;
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;
typedef vector<long long> vll;
typedef vector<vll> vvll;
typedef long double ld;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<vii> vvii;
typedef tuple<int,int,int> iii;
typedef set<int> si;
typedef complex<double> pnt;
typedef vector<pnt> vpnt;
typedef priority_queue<ii,vii,greater<ii> > spq;
const ll MOD=1000000007LL;
template<typename T> T gcd(T a,T b){if(a==0) return b; return gcd(b%a,a);}
template<typename T> T power(T x,T y,ll m=MOD){T ans=1;while(y>0){if(y&1LL) ans=(ans*x)%m;y>>=1LL;x=(x*x)%m;}return ans%m;}
int a[N];
vector<int> seg[N];
void build(int s,int e,int n){
int mid=(s+e)/2,l=2*n,r=l+1;
for(int i=s;i<=e;i++){
seg[n].eb(a[i]);
}
sort(all(seg[n]));
if(s==e) return;
build(s,mid,l); build(mid+1,e,r);
}
int query(int n,int s,int e,int qs,int qe,int val,int t){
int mid=(s+e)/2,l=2*n,r=l+1;
if(s>qe || e<qs || s>e) return 0;
if(s>=qs && e<=qe){
if(t==1){
// trace3(qs,qe,val);
auto idx=lower_bound(all(seg[n]),val);
return idx-seg[n].begin();
}
else{
auto idx=upper_bound(all(seg[n]),val);
return seg[n].end()-idx;
}
}
return query(l,s,mid,qs,qe,val,t)+query(r,mid+1,e,qs,qe,val,t);
}
int32_t main(){
sync;
int n,m; cin>>n>>m;
rep(i,0,n){
cin>>a[i];
}
build(0,n-1,1);
ld(m){
int ax,b,c; cin>>ax>>b>>c; --ax; --b; --c;
int t1=query(1,0,n-1,ax,c,a[c],2);
int t2=query(1,0,n-1,c,b,a[c],1);
// trace2(t1,t2);
if(t1==t2) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2RlZmluZSBpbnQgbG9uZyBsb25nCiNkZWZpbmUgcGIgcHVzaF9iYWNrCiNkZWZpbmUgZWIgZW1wbGFjZV9iYWNrCiNkZWZpbmUgbXAgbWFrZV9wYWlyCiNkZWZpbmUgbXQgbWFrZV90dXBsZQojZGVmaW5lIGxkKGEpIHdoaWxlKGEtLSkKI2RlZmluZSB0Y2kodixpKSBmb3IoYXV0byBpPXYuYmVnaW4oKTtpIT12LmVuZCgpO2krKykKI2RlZmluZSB0Y2YodixpKSBmb3IoYXV0byBpIDogdikKI2RlZmluZSBhbGwodikgdi5iZWdpbigpLHYuZW5kKCkKI2RlZmluZSByZXAoaSxzdGFydCxsaW0pIGZvcihsb25nIGxvbmcgKGkpPShzdGFydCk7aTwobGltKTtpKyspCi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