#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long inf = 1e9;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
long long leastbit(long long a) { return a & (-a); }
long long C(int a, int b) {
  long long res = 1;
  for (int i = 0; i < b; i++) res = res * (a - i) / (i + 1);
  return res;
}
long long powmod(long long a, long long b) {
  if (b == 0) return 1;
  long long cnt = powmod(a, b / 2);
  (cnt *= cnt) %= mod;
  if (b & 1) {
    (cnt *= a) %= mod;
  }
  return cnt;
}
int x;
class segtree {
 public:
  vector<long long> arr;
  vector<long long> v;
  int n, i;
  segtree(int SZ) {
    i = 0;
    n = SZ;
    arr.assign(4 * n, 0);
  }
  void sett(int p, int l, int r, int i, int x) {
    if (l == r) {
      arr[p] = x;
      return;
    }
    int mid = (l + r) >> 1;
    if (i <= mid)
      sett(2 * p, l, mid, i, x);
    else
      sett(2 * p + 1, mid + 1, r, i, x);
    arr[p] = gcd(arr[2 * p], arr[2 * p + 1]);
  }
  void sett(int j, int x) { sett(1, 0, n - 1, j, x); }
  int sum(int p, int l, int r, int a, int b) {
    if (b < l || a > r) return 0;
    if (l == r) {
      return gcd(arr[p], x) != x;
    }
    if (gcd(arr[p], x) == x) return 0;
    int mid = (l + r) >> 1;
    int ret = sum(p * 2 + 1, mid + 1, r, a, b);
    if (ret > 1)
      return ret;
    else
      return ret + sum(p * 2, l, mid, a, b);
  }
  long long sum(int l, int r) { return sum(1, 0, n - 1, l, r); }
};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  segtree seg(n);
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    seg.sett(i, x);
  }
  int m;
  cin >> m;
  while (m--) {
    int ch;
    cin >> ch;
    if (ch == 1) {
      int l, r;
      cin >> l >> r >> x;
      l--;
      r--;
      int hi = seg.sum(l, r);
      if (hi <= 1)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    } else {
      int x, y;
      cin >> x >> y;
      seg.sett(x - 1, y);
    }
  }
  return 0;
}
