#include<bits/stdc++.h>
using namespace std;
using ll=long long int;
void show(auto x){ cout<<x<<"\n";}
void show1(auto v){ ll n=(signed)v.size();for(int i=0;i<n;i++){cout<<v[i]<<" ";}cout<<"\n";}
void show2(auto v){ ll n=(signed)v.size();for(int i=0;i<n;i++){ cout<<v[i]<<"\n";}}
int main()
{
ll n;cin>>n;
vector<ll> v(n+1);
for(int i=1;i<=n;i++)
{
cin>>v[i];
}
ll q;cin>>q;
while(q--)
{
ll x;cin>>x;
if(x==1)
{
ll index,val;
cin>>index>>val;
v[index]=val;
}
else
{
ll l,r;cin>>l>>r;
vector<ll> arr;
for(int i=l;i<=r;i++)
{
arr.push_back(v[i]);
}
vector<ll> temp=arr;
sort(arr.begin(),arr.end());
if(arr==temp)
{
show("YES");
}
else
{
show("NO");
}
}
}
}