#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N = 2e5 + 10;
const ll MOD = 1e9 + 7;
bool ans = true;
void mergeSort(vector<int> &v, int low, int high) {
if(low >= high) return;
int mid = low + (high - low) / 2;
ans &= (v[mid] <= v[mid + 1]);
if(ans) mergeSort(v, low, mid);
if(ans) mergeSort(v, mid + 1, high);
}
void solve()
{
int n;
cin >> n;
vector<int> v(n);
for(int i = 0; i < n; i++) {
cin >> v[i];
}
int q;
cin >> q;
while(q--) {
int type, a, b;
cin >> type >> a >> b;
a--, b--;
if(type == 1) v[a] = b + 1;
else {
ans = true;
mergeSort(v, a, b);
if(ans) cout << "YES" << "\n";
else cout << "NO" << "\n";
}
}
}
int main()
{
ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
solve();
}