#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 1000000007;
#define sz(x) (ll)(x).size()
#define rd ({ll x; cin >> x; x; })
#define dbg(x) cerr << "[" #x "] " << (x) << "\n\n"
// #define errv(x) {cerr << "["#x"] ["; for (const auto& ___ : (x)) cerr << ___ << ", "; cerr << "]\n";}
// #define errvn(x, n) {cerr << "["#x"] ["; for (auto ___ = 0; ___ < (n); ++___) cerr << (x)[___] << ", "; cerr << "]\n";}
// #define cerr if(0)cerr
#define xx first
#define yy second
mt19937 rnd(std::chrono::high_resolution_clock::now().time_since_epoch().count());
/*_________________________________________________________________________________________________________________________*/
void Solve()
{
ll n;
cin >> n;
vector<ll> arr(n + 2, 0);
arr[n + 1] = LLONG_MAX;
for (int i = 1; i <= n; i++)
cin >> arr[i];
set<ll> problems;
for (int i = 1; i <= n; i++) {
if (!(arr[i - 1] <= arr[i] && arr[i] <= arr[i + 1]))
problems.insert(i);
}
ll q;
cin >> q;
while (q--) {
ll qr, x, y;
cin >> qr >> x >> y;
if (qr == 2) {
if (y - x + 1 < 10) {
vector<ll> tmp, tmp2;
for (int i = x; i <= y; i++)
tmp.push_back(arr[i]);
tmp2 = tmp;
sort(tmp2.begin(), tmp2.end());
if (tmp == tmp2)
cout << "YES\n";
else
cout << "NO\n";
continue;
}
auto it = problems.lower_bound(x + 1);
if (it == problems.end() || *it >= y)
cout << "YES\n";
else
cout << "NO\n";
} else {
problems.erase(x - 1);
problems.erase(x);
problems.erase(x + 1);
arr[x] = y;
if (x - 1 > 0) {
if (!(arr[x - 2] <= arr[x - 1] && arr[x - 1] <= arr[x]))
problems.insert(x - 1);
}
if (x + 1 <= n) {
if (!(arr[x] <= arr[x + 1] && arr[x + 1] <= arr[x + 2]))
problems.insert(x);
}
if (!(arr[x - 1] <= arr[x] && arr[x] <= arr[x + 1]))
problems.insert(x);
}
}
}
int32_t main()
{
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int t = 1;
// cin >> t;
for (int i = 1; i <= t; i++) {
// cout << "Case #" << i << ": "; // cout << "Case " << i << ": ";
Solve();
}
return 0;
}
// Coded by Tahsin Arafat (@TahsinArafat)