#include<bits/stdc++.h>
using namespace std;
int n,m,a[500005],sum[500005<<2];
int q,b,c,d,tot;
int gcd(int x,int y){
return y?gcd(y,x%y):x;
}
void pushup(int k){
sum[k]=gcd(sum[k<<1],sum[k<<1|1]);
}
void build(int k,int l,int r){
if(l==r)
{
sum[k]=a[l];
return ;
}
int m=(l+r)>>1;
build(k<<1,l,m);
build(k<<1|1,m+1,r);
pushup(k);
}
void plusn(int b,int c,int l,int r,int k){
if(l==r&&r==b){
sum[k]=c;
return ;
}
int m=(l+r)>>1;
if(b<=m){
plusn(b,c,l,m,k<<1);
}
else{
plusn(b,c,m+1,r,k<<1|1);
}
pushup(k);
}
void AC(int b,int c,int d,int l,int r,int k){
if(tot>1) return ;
if(l==r) {
tot++;
return ;
}
int m=(l+r)>>1;
if(b<=m&&sum[k<<1]%d!=0)
{
AC(b,c,d,l,m,k<<1);
}
if(c>m&&sum[k<<1|1]%d!=0)
{
AC(b,c,d,m+1,r,k<<1|1);
}
}
int main(){
scanf("%d",&n);
for(int i=1;i<=n;i++) scanf("%d",&a[i]);
build(1,1,n);
scanf("%d",&m);
for(int i=1;i<=m;i++){
scanf("%d",&q);
if(q==2){
scanf("%d%d",&b,&c);
plusn(b,c,1,n,1);
}
else{
scanf("%d%d%d",&b,&c,&d);
tot=0;
AC(b,c,d,1,n,1);
if(tot>1)
cout<<"NO"<<endl;
else cout<<"YES"<<endl;
}
}
return 0;
}