#include <bits/stdc++.h>
#define ll long long
using namespace std;
#ifdef velox
#include "debug.h"
#else
#define debug(x...)
#endif
const ll N = 2e5+10;
vector<ll> tree(4*N),v(N);
void make(ll node,ll b,ll e){
if(b == e){
if(v[b] > v[b+1]) tree[node] = 1;
else tree[node] = 0;
return;
}
ll mid=(b+e)/2;
ll l=(node*2);
ll r=(node*2)+1;
make(l,b,mid);
make(r,mid+1,e);
tree[node]=tree[l]+tree[r];
}
void update(ll node,ll b, ll e, ll in, ll val){
if(in>e || in<b) return;
if(b >= in && e <= in){
if(v[in] > v[in+1]) tree[node] = 1;
else tree[node] = 0;
return;
}
ll mid=(b+e)/2;
ll l=(node*2);
ll r=(node*2)+1;
update(l,b,mid,in,val);
update(r,mid+1,e,in,val);
tree[node]=tree[l]+tree[r];
}
ll query(ll node,ll b, ll e, ll i,ll j){
if(i>e || j<b) return 0;
if(i<=b && j>=e) return tree[node];
ll mid=(b+e)/2;
ll l=(node*2);
ll r=(node*2)+1;
return query(l,b,mid,i,j)+query(l,mid+1,e,i,j);
}
int main(){
ios_base::sync_with_stdio(false); cin.tie(nullptr);
ll len; cin >> len;
for(int x=1; x<=len; x++) cin >> v[x];
len--;
make(1,1,len);
ll q; cin >> q;
while(q--){
ll op; cin >> op;
if(op == 1){
int l, r; cin >> l >> r;
v[l] = r;
update(1, 1, len, l-1, r);
if(l <= len) update(1, 1, len, l, r);
}
else{
int l, r, val; cin >> l >> r;
if(l == r){
cout << "YES" << endl;
continue;
}
if(query(1, 1, len, l, r-1) == 0) cout << "YES" << endl;
else cout << "NO" << endl;
}
}
return 0;
}