#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define mx 200005
ll arr[mx];
ll Tree[mx * 3];
void init(int node, int b, int e){
if(b == e){
if(arr[b] > arr[b+1]) Tree[node] = 1;
else Tree[node] = 0;
return;
}
int left = node * 2;
int right = node * 2 + 1;
int mid = (b + e) / 2;
init(left, b, mid);
init(right, mid+1, e);
Tree[node] = Tree[left] + Tree[right];
}
ll query(int node, int b, int e, int i, int j){
if(i > e || j < b) return 0;
if(b >= i && e <= j) return Tree[node];
int left = node * 2;
int right = node * 2 + 1;
int mid = (b + e) / 2;
ll p1 = query(left, b, mid, i, j);
ll p2 = query(right, mid+1, e, i, j);
return p1 + p2;
}
void update(int node, int b, int e, int i, int newvalue){
if(i > e || i < b) return;
if(b >= i && e <= i){
if(arr[i] > arr[i+1]) Tree[node] = 1;
else Tree[node] = 0;
return;
}
int left = node * 2;
int right = node * 2 + 1;
int mid = (b + e) / 2;
update(left, b, mid, i, newvalue);
update(right, mid+1, e, i, newvalue);
Tree[node] = Tree[left] + Tree[right];
}
int main(){
ll n, q; cin >> n;
for(int i = 1; i <= n; i++) cin >> arr[i];
n--;
init(1, 1, n);
cin >> q;
while(q--){
int qe; cin >> qe;
if(qe == 1){
int l, r; cin >> l >> r;
arr[l] = r;
update(1, 1, n, l-1, r);
if(l <= n) update(1, 1, n, l, r);
}
else{
int l, r, val; cin >> l >> r;
if(l == r){
cout << "YES\n";
continue;
}
if(query(1, 1, n, l, r-1) == 0) cout << "YES\n";
else cout << "NO\n";
}
}
}