#include <bits/stdc++.h>
const int N = 5e5 + 5;
int n, q, cnt, seg[N << 2];
int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
void pushup(int rt) { seg[rt] = gcd(seg[rt << 1], seg[rt << 1 | 1]); }
void build(int rt, int l, int r) {
  if (l == r) {
    scanf("%d", &seg[rt]);
    return;
  }
  int mid = (l + r) >> 1;
  build(rt << 1, l, mid);
  build(rt << 1 | 1, mid + 1, r);
  pushup(rt);
}
void modify(int x, int rt, int l, int r, int val) {
  if (l == r) {
    seg[rt] = val;
    return;
  }
  int mid = (l + r) >> 1;
  if (x <= mid)
    modify(x, rt << 1, l, mid, val);
  else
    modify(x, rt << 1 | 1, mid + 1, r, val);
  pushup(rt);
}
void query(int x, int y, int rt, int l, int r, int d) {
  if (cnt > 1) return;
  if (l == r) {
    ++cnt;
    return;
  }
  int mid = (l + r) >> 1;
  if (x <= mid && seg[rt << 1] % d) query(x, y, rt << 1, l, mid, d);
  if (mid < y && seg[rt << 1 | 1] % d) query(x, y, rt << 1 | 1, mid + 1, r, d);
}
int main() {
  scanf("%d", &n);
  build(1, 1, n);
  for (scanf("%d", &q); q--;) {
    int opt;
    scanf("%d", &opt);
    if (opt == 1) {
      int l, r, x;
      scanf("%d%d%d", &l, &r, &x);
      cnt = 0, query(l, r, 1, 1, n, x);
      puts(cnt > 1 ? "NO" : "YES");
    } else {
      int x, k;
      scanf("%d%d", &x, &k);
      modify(x, 1, 1, n, k);
    }
  }
  return 0;
}
