/**
* written by Binoy Barman .
**/
#include<bits/stdc++.h>
using namespace std;
#define nl '\n'
#define all(v) v.begin(), v.end()
#define Too_Many_Jobs int tts, tc = 1; cin >> tts; hell: while(tts--)
#define Dark_Lord_Binoy ios_base::sync_with_stdio(false); cin.tie(NULL);
#ifdef LOCAL
#include "unravel.hpp"
#else
#define dbg(...) 42
#endif
#define int long long
const int N = 3e5 + 9;
int a[N];
struct Node {
int first, last;
bool sorted;
Node() {
first = last = -1;
sorted = true;
}
};
struct SegmentTree {
#define lc (n << 1)
#define rc ((n << 1) | 1)
vector<Node> t;
SegmentTree() {
t.resize(4 * N);
}
inline void pull(int n) {
t[n].first = t[lc].first;
t[n].last = t[rc].last;
t[n].sorted = (t[lc].sorted && t[rc].sorted && t[lc].last <= t[rc].first);
}
void build(int n, int b, int e) {
if (b == e) {
t[n].first = a[b];
t[n].last = a[b];
t[n].sorted = true;
return;
}
int mid = (b + e) >> 1;
build(lc, b, mid);
build(rc, mid + 1, e);
pull(n);
}
void upd(int n, int b, int e, int i, int x) {
if (b > i || e < i) return;
if (b == e && b == i) {
t[n].first = x;
t[n].last = x;
t[n].sorted = true;
return;
}
int mid = (b + e) >> 1;
upd(lc, b, mid, i, x);
upd(rc, mid + 1, e, i, x);
pull(n);
}
bool query(int n, int b, int e, int i, int j) {
if (b > j || e < i) return true;
if (b >= i && e <= j) return t[n].sorted;
int mid = (b + e) >> 1;
return (query(lc, b, mid, i, j) && query(rc, mid + 1, e, i, j));
}
}t;
int32_t main() {
Dark_Lord_Binoy
#ifdef LOCAL
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int n, q;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
t.build(1, 1, n);
cin >> q;
while(q--) {
int c, l, r;
cin >> c >> l >> r;
if(c == 1) {
t.upd(1, 1, n, l, r);
}
else {
cout << (t.query(1, 1, n, l, r) ? "YES" : "NO") << nl;
}
}
return 0;
}