#include <bits/stdc++.h>
using namespace std;
#define Fin freopen("input.txt","r",stdin)
#define Fout freopen("output.txt","w",stdout)
const int mxN = 2e5 + 1;
int ar[mxN];
int seg[mxN << 2];
void Build(int cur, int left , int right) {
if (left == right) {
seg[cur] = ar[left];
return ;
}
int mid = (left + right) >> 1;
Build(cur << 1 , left , mid);
Build(cur << 1 | 1 , mid + 1 , right);
seg[cur] = __gcd(seg[cur << 1] , seg[cur << 1 | 1]);
}
int Query(int cur , int left , int right , int l , int r) {
if (right < l || r < left) return 0;
if (l <= left && right <= r) return seg[cur];
int mid = (left + right) >> 1;
int a = Query(cur << 1 , left , mid, l , r);
int b = Query(cur << 1 | 1 , mid + 1, right , l , r);
return __gcd(a , b);
}
void Update(int cur , int left , int right , int pos, int val) {
if (right < pos || pos < left) return;
if (pos <= left && right <= pos) {
seg[cur] = val;
ar[pos] = val;
return;
}
int mid = (left + right) >> 1;
Update(cur << 1, left , mid , pos , val);
Update(cur << 1 | 1 , mid + 1, right , pos , val);
seg[cur] = __gcd(seg[cur << 1] , seg[cur << 1 | 1]);
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
//Fin;
//Fout;
int n , q; cin >> n >> q;
for (int i = 1; i <= n; i++) cin >> ar[i];
Build(1 , 1 , n);
while (q--) {
int t; cin >> t;
if (t == 1) {
int k , u; cin >> k >> u;
Update(1 , 1 , n, k , u);
} else {
int l , r , x;
cin >> l >> r >> x;
cout << ((Query(1 ,1 , n , l , r) % x)? "No\n" : "Yes\n");
}
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgojZGVmaW5lIEZpbiAgICAgICAgICBmcmVvcGVuKCJpbnB1dC50eHQiLCJyIixzdGRpbikKI2RlZmluZSBGb3V0ICAgICAgICAgZnJlb3Blbigib3V0cHV0LnR4dCIsInciLHN0ZG91dCkKCmNvbnN0IGludCBteE4gPSAyZTUgKyAxOwppbnQgYXJ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