#include <bits/stdc++.h>
using namespace std;
const int N = int(5e5);
int GCD(int x, int y) { return y ? GCD(y, x % y) : x; }
struct TREE {
  int l, r, gcd;
  TREE() {}
  TREE(int _l, int _r, int _gcd) : l(_l), r(_r), gcd(_gcd) {}
} tre[N * 6];
int n, m;
int beg[N + 5];
void Update(int x) { tre[x].gcd = GCD(tre[x << 1].gcd, tre[x << 1 | 1].gcd); }
void Build(int x, int L, int R) {
  tre[x] = TREE(L, R, 0);
  if (L == R) {
    tre[x] = TREE(L, R, beg[L]);
    return;
  }
  int mid = (L + R) >> 1;
  Build(x << 1, L, mid);
  Build(x << 1 | 1, mid + 1, R);
  Update(x);
}
void Modify(int x, int pos, int num) {
  if (!(tre[x].l <= pos && pos <= tre[x].r)) return;
  if (tre[x].l == tre[x].r) {
    tre[x].gcd = num;
    return;
  }
  Modify(x << 1, pos, num);
  Modify(x << 1 | 1, pos, num);
  Update(x);
}
int mdy_cnt;
bool Query(int x, int l, int r, int num) {
  if (tre[x].r < l || r < tre[x].l) return true;
  if (tre[x].l == tre[x].r) {
    if (tre[x].gcd % num == 0)
      return true;
    else {
      mdy_cnt++;
      return mdy_cnt <= 1;
    }
  }
  if (l <= tre[x].l && tre[x].r <= r) {
    if (tre[x].gcd % num == 0) return true;
    if (tre[x << 1].gcd % num == 0) return Query(x << 1 | 1, l, r, num);
    if (tre[x << 1 | 1].gcd % num == 0) return Query(x << 1, l, r, num);
    return false;
  } else
    return Query(x << 1, l, r, num) & Query(x << 1 | 1, l, r, num);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &beg[i]);
  Build(1, 1, n);
  scanf("%d", &m);
  while (m--) {
    int cmd;
    scanf("%d", &cmd);
    if (cmd == 1) {
      int l, r, gcd;
      scanf("%d%d%d", &l, &r, &gcd);
      mdy_cnt = 0;
      printf("%s\n", Query(1, l, r, gcd) ? "YES" : "NO");
    } else {
      int x, num;
      scanf("%d%d", &x, &num);
      Modify(1, x, num);
    }
  }
  return 0;
}
