#include<bits/stdc++.h>
using namespace std;
using ll=long long int;
void fastio(){ios::sync_with_stdio(false);cin.tie(0);}
vector<ll> take_inputs_0(ll n){vector<ll> v(n);for(int i=0;i<n;i++){cin>>v[i];}return v;}
vector<ll> take_inputs_1(ll n){vector<ll> v(n);for(int i=1;i<n;i++){cin>>v[i];}return v;}
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";}}
void sort_it(auto &v){ sort(v.begin(),v.end());}
void reverse_it(auto &v){ reverse(v.begin(),v.end());}
void do_both(auto &v){ sort(v.begin(),v.end());reverse(v.begin(),v.end());}
auto find_max(auto v){ sort(v.begin(),v.end());reverse(v.begin(),v.end());return v[0];}
auto find_min(auto v){ sort(v.begin(),v.end());return v[0];}
vector<ll> bitRep64(ll n){vector<ll> v;int i=0;while(i<=63){if(n&(1LL<<i)){v.push_back(1);}else{v.push_back(0);}i++;}return v;}
vector<ll> bitRep32(ll n){vector<ll> v;int i=0;while(i<=31){if(n&(1LL<<i)){v.push_back(1);}else{v.push_back(0);}i++;}return v;}
vector<string> all_subset(ll n){vector<string> v;for(int i=0;i<(1<<n);i++){string st="";for(int j=0;j<n;j++){if(i&(1<<j)){st+="1";}else{st+="0";}}v.push_back(st);}return v;}
vector<ll> prefix_sum_0(vector<ll> v){ll n=(signed)v.size();for(int i=1;i<n;i++){v[i]=v[i-1]+v[i];}return v;}
vector<ll> prefix_sum_1(vector<ll> v){ll n=(signed)v.size();vector<ll> summ(n+1);for(int i=1;i<=n;i++){summ[i]=summ[i-1]+v[i-1];}return summ;}
///////////////////////////////////
int main()
{
ll n;;cin>>n;
vector<ll> v(n+1);
for(int i=1;i<=n;i++)
{
cin>>v[i];
}
set<ll> st;
for(int i=1;i<=n;i++)
{
if(i==1)
{
if(v[i]>v[i+1])
{
st.insert(i);
}
}
else if(i==n)
{
if(v[i-1]>v[i])
{
st.insert(i);
}
}
else
{
if(v[i-1]>v[i] || v[i]>v[i+1])
{
st.insert(i);
}
}
}
ll q;cin>>q;
while(q--)
{
ll x;cin>>x;
if(x==1)
{
ll ind,val;cin>>ind>>val;
st.erase(ind);
v[ind]=val;
if(n==1)
{
continue;
}
else if(n==2)
{
if(ind==1)
{
if(v[ind]>v[ind+1])
{
st.insert(1);
st.insert(2);
}
else
{
st.erase(1);
st.erase(2);
}
}
else
{
if(v[ind-1]<v[ind])
{
st.insert(1);
st.insert(2);
}
else
{
st.erase(1);
st.erase(2);
}
}
}
else
{
if(ind==1)
{
if(v[ind]>v[ind+1])
{
st.insert(ind);
st.insert(ind+1);
}
else if(v[ind+1]<=v[ind+2])
{
st.erase(ind+1);
}
}
else if(ind==n)
{
if(v[ind]<v[ind-1])
{
st.insert(ind);
st.insert(ind-1);
}
else if(v[ind-1]>=v[ind-2])
{
st.erase(ind-1);
}
}
else
{
ll a=max(1LL,ind-2);
ll b=min(n,ind+2);
for(int i=a+1;i<=b-1;i++)
{
if(v[i-1]<=v[i] && v[i+1]>=v[i])
{
st.erase(i);
}
else
{
st.insert(i);
}
}
}
}
}
else
{
ll l,r;cin>>l>>r;
auto it=st.lower_bound(l);
ll index=*it;
if(l==r)
{
show("YES");
}
else if(st.size()==0)
{
show("YES");
}
else if(index>r)
{
show("YES");
}
else if(st.size()>0 && n==2)
{
show("NO");
}
else if(st.size()==0 && n==2)
{
show("YES");
}
else if(index>=l && index<=r)
{
if(index==l)
{
if(v[index+1]<v[index])
{
show("NO");
}
else
{
show("YES");
}
}
else if(index==r)
{
if(v[index-1]>v[index])
{
show("NO");
}
else
{
show("YES");
}
}
else
{
if(v[index-1]>v[index] || v[index]>v[index+1])
{
show("NO");
}
else
{
show("YES");
}
}
}
}
}
return 0;
}