#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
int n;
int a[N];
int q;
int gcd(int x, int y) {
  int q, temp;
  int oldr, r;
  int olds = 1, s = 0;
  int oldt = 0, t = 1;
  if (x > y) swap(x, y);
  if (x == 0) return y;
  oldr = x;
  r = y;
  while (r != 0) {
    q = oldr / r;
    temp = r;
    r = oldr - q * r;
    oldr = temp;
    temp = s;
    s = olds - q * s;
    olds = temp;
    temp = t;
    t = oldt - q * t;
    oldt = temp;
  }
  return oldr;
}
int seg[4 * N];
void build_tree(int pos, int low, int high) {
  if (low == high) {
    seg[pos] = a[low];
    return;
  }
  int mid = (low + high) / 2;
  build_tree(pos * 2, low, mid);
  build_tree(pos * 2 + 1, mid + 1, high);
  seg[pos] = gcd(seg[pos * 2], seg[pos * 2 + 1]);
}
void update(int pos, int low, int high, int at, int x) {
  if (low > at || high < at) return;
  if (low == at && high == at) {
    seg[pos] = x;
    return;
  }
  int mid = (low + high) / 2;
  update(pos * 2, low, mid, at, x);
  update(pos * 2 + 1, mid + 1, high, at, x);
  seg[pos] = gcd(seg[pos * 2], seg[pos * 2 + 1]);
}
int query(int pos, int low, int high, int l, int r) {
  if (l > high || r < low) {
    return 0;
  }
  if (l <= low && r >= high) {
    return seg[pos];
  }
  int mid = (low + high) / 2;
  return gcd(query(pos * 2, low, mid, l, r),
             query(pos * 2 + 1, mid + 1, high, l, r));
}
int get_first(int pos, int low, int high, int x) {
  if (low == high) return low;
  int left, right;
  left = seg[pos * 2];
  right = seg[pos * 2 + 1];
  int mid = (low + high) / 2;
  if (left % x != 0)
    return get_first(pos * 2, low, mid, x);
  else
    return get_first(pos * 2 + 1, mid + 1, high, x);
}
int rem;
void query_rem(int pos, int low, int high, int l, int r, int x) {
  if (rem > -1) return;
  if (l > high || r < low) {
    return;
  }
  if (l <= low && r >= high) {
    if (seg[pos] % x == 0) return;
    rem = get_first(pos, low, high, x);
    return;
  }
  int mid = (low + high) / 2;
  query_rem(pos * 2, low, mid, l, r, x);
  query_rem(pos * 2 + 1, mid + 1, high, l, r, x);
}
bool ask(int l, int r, int x) {
  rem = -1;
  query_rem(1, 1, n, l, r, x);
  if (rem == -1) return true;
  if (rem == l) {
    if (query(1, 1, n, l + 1, r) % x == 0)
      return true;
    else
      return false;
  }
  if (rem == r) {
    if (query(1, 1, n, l, r - 1) % x == 0)
      return true;
    else
      return false;
  }
  if (query(1, 1, n, l, rem - 1) % x == 0 &&
      query(1, 1, n, rem + 1, r) % x == 0)
    return true;
  else
    return false;
}
int main() {
  int i;
  int t, l, r, x;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  build_tree(1, 1, n);
  scanf("%d", &q);
  while (q--) {
    scanf("%d", &t);
    if (t == 1) {
      scanf("%d%d%d", &l, &r, &x);
      if (ask(l, r, x))
        printf("YES\n");
      else
        printf("NO\n");
    }
    if (t == 2) {
      scanf("%d%d", &i, &x);
      update(1, 1, n, i, x);
    }
  }
  return 0;
}
