#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <queue>
#include <map>
#include <vector>
using namespace std;
#define lson i<<1
#define rson (i<<1)|1
int n,q;
int a[500005];
struct node
{
int l,r;
int gcd;
}tr[500005*5];
int fgcd(int a,int b)
{
if(b==0)
return a;
else
return fgcd(b,a%b);
}
node up(int i)
{
node ntr;
ntr.l=tr[lson].l;ntr.r=tr[rson].r;
ntr.gcd=fgcd(tr[lson].gcd,tr[rson].gcd);
return ntr;
}
void build(int i,int l,int r)
{
tr[i].l=l;tr[i].r=r;
if(l==r)
{
tr[i].gcd=a[l];
} else
{
int mid=(l+r)/2;
build(lson,l,mid);
build(rson,mid+1,r);
tr[i]=up(i);
}
}
void update(int i,int l,int r,int L,int R,int y)
{
if(l==L && r==R)
{
tr[i].gcd=y;
}
else
{
int mid=(l+r)/2;
if(R<=mid)
update(lson,l,mid,L,R,y);
else if(L>mid)
update(rson,mid+1,r,L,R,y);
else
{
update(lson,l,mid,L,mid,y);
update(rson,mid+1,r,mid+1,R,y);
}
tr[i]=up(i);
}
}
int ansf;
bool query(int i,int l,int r,int L,int R,int x)
{
if(ansf==0)
return false;
if(l==L && r==R)
{
if(tr[i].gcd%x==0)
return true;
if(l!=r && tr[lson].gcd%x!=0 && tr[rson].gcd%x!=0)
{
ansf=0;
return false;
}
}
if(l==r)
if(tr[i].gcd%x==0)
return true;
else
return false;
int mid=(l+r)/2;
if(R<=mid)
{
return query(lson,l,mid,L,R,x);
}
else if(L>mid)
{
return query(rson,mid+1,r,L,R,x);
}
else
{
bool ans1=query(lson,l,mid,L,mid,x);
bool ans2=query(rson,mid+1,r,mid+1,R,x);
if(ans1==false && ans2==false)
ansf=0;
if(ans1==false || ans2==false)
return false;
if(ans1==true && ans2==true)
return true;
}
}
int main() {
while(~scanf("%d",&n))
{
for(int i=1;i<=n;i++)
{
scanf("%d",&a[i]);
}
scanf("%d",&q);
build(1,1,n);
while(q--)
{
int f;
scanf("%d",&f);
if(f==1)
{
int l,r,x;
scanf("%d%d%d",&l,&r,&x);
ansf=1;
query(1,1,n,l,r,x);
if(ansf==1)
printf("YES\n");
else
printf("NO\n");
} else
{
int i,y;
scanf("%d%d",&i,&y);
update(1,1,n,i,i,y);
}
}
}
return 0;
}