#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 10;
int n;
int gcd(int a, int b) {
  if (!a)
    return b;
  else
    return gcd(b % a, a);
}
vector<int> cnt(4 * maxn, 0);
vector<int> a(maxn);
void build(int l, int r, int v) {
  if (l == r) {
    cnt[v] = a[l];
    return;
  }
  int m = (l + r) / 2;
  build(l, m, v * 2 + 1);
  build(m + 1, r, v * 2 + 2);
  cnt[v] = gcd(cnt[v * 2 + 1], cnt[v * 2 + 2]);
}
void upd(int index, int val, int l, int r, int v) {
  if (l == r) {
    cnt[v] = val;
    return;
  }
  int m = (l + r) / 2;
  if (index <= m)
    upd(index, val, l, m, v * 2 + 1);
  else
    upd(index, val, m + 1, r, v * 2 + 2);
  cnt[v] = gcd(cnt[v * 2 + 1], cnt[v * 2 + 2]);
}
int get(int l, int r, int v, int x) {
  if (cnt[v] % x == 0) return 0;
  if (l == r)
    return 1;
  else if (cnt[v * 2 + 1] % x != 0 && cnt[v * 2 + 2] % x != 0)
    return 2;
  int m = (l + r) / 2;
  int tmp = get(l, m, v * 2 + 1, x);
  if (tmp > 1)
    return tmp;
  else
    return tmp + get(m + 1, r, v * 2 + 2, x);
}
int check(int l, int r, int tl, int tr, int v, int x) {
  if (l > tr || r < tl) return 0;
  if (l <= tl && r >= tr) {
    return get(tl, tr, v, x);
  } else {
    int tm = (tl + tr) / 2;
    int tmp = check(l, r, tl, tm, v * 2 + 1, x);
    if (tmp > 1)
      return tmp;
    else
      return tmp + check(l, r, tm + 1, tr, v * 2 + 2, x);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  build(0, n - 1, 0);
  int q;
  cin >> q;
  while (q--) {
    int t;
    cin >> t;
    if (t == 1) {
      int l, r, x;
      cin >> l >> r >> x;
      l--;
      r--;
      if (check(l, r, 0, n - 1, 0, x) <= 1)
        cout << "YES" << '\n';
      else
        cout << "NO" << '\n';
    } else {
      int y, x;
      cin >> y >> x;
      y--;
      upd(y, x, 0, n - 1, 0);
    }
  }
  return 0;
}
