#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pi (3.141592653589)
#define mod 1000000007
#define pb push_back
#define vi vector<ll>
#define mp make_pair
#define f first
#define s second
#define sz(container) (ll) container.size()
#define setp(x) cout << fixed << setprecision(x)
#define all(container) container.begin(), container.end()
#define rall(container) container.rbegin(), container.rend()
#define fast ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
struct SegmentTree
{
int n;
vector<bool> st;
vi arr;
SegmentTree(int n) : n(n), st(4 * n, true), arr(n) {}
void build(int start, int end, int node)
{
if (start == end)
{
return;
}
int mid = (start + end) / 2;
build(start, mid, 2 * node + 1);
build(mid + 1, end, 2 * node + 2);
st[node] = st[2 * node + 1] && st[2 * node + 2] && (arr[mid] <= arr[mid + 1]);
}
void update(int start, int end, int node, int idx, ll val)
{
if (start == end)
{
arr[start] = val;
return;
}
int mid = (start + end) / 2;
if (idx <= mid)
{
update(start, mid, 2 * node + 1, idx, val);
}
else
{
update(mid + 1, end, 2 * node + 2, idx, val);
}
st[node] = st[2 * node + 1] && st[2 * node + 2] && (arr[mid] <= arr[mid + 1]);
}
bool query(int start, int end, int l, int r, int node)
{
if (r < start || l > end)
{
return true;
}
if (l <= start && end <= r)
{
return st[node];
}
int mid = (start + end) / 2;
bool left = query(start, mid, l, r, 2 * node + 1);
bool right = query(mid + 1, end, l, r, 2 * node + 2);
bool cross = true;
if (l <= mid && r > mid)
{
cross = arr[mid] <= arr[mid + 1];
}
return left && right && cross;
}
void build(vi &inputArr)
{
arr = inputArr;
build(0, n - 1, 0);
}
void update(int idx, ll val)
{
update(0, n - 1, 0, idx, val);
}
bool query(int l, int r)
{
return query(0, n - 1, l, r, 0);
}
};
int main()
{
fast;
ll n;
cin >> n;
vi arr(n);
for (ll i = 0; i < n; i++)
{
cin >> arr[i];
}
SegmentTree segTree(n);
segTree.build(arr);
// for (int i = 0; i < 4 * n; i++)
// {
// cout << segTree.st[i] << " ";
// }
ll q;
cin >> q;
while (q--)
{
ll x, l, r;
cin >> x >> l >> r;
if (x == 1)
{
segTree.update(l - 1, r);
}
else
{
cout << (segTree.query(l - 1, r - 1) ? "YES" : "NO") << "\n";
}
}
return 0;
}