#include <bits/stdc++.h>
using namespace std;
const long long maxn = 100000;
long long allowed = 0;
long long tree[20 * maxn] = {0};
long long a[5 * maxn];
long long gcd(long long x, long long y) {
  if (x * y == 0) return (x + y);
  return (gcd(y, x % y));
}
void query(long long node, long long start, long long end, long long l,
           long long r, long long x) {
  if (end < l or start > r or start > end or l > r) {
    return;
  }
  if (l <= start and end <= r and start != end) {
    if (tree[node] % x == 0) return;
    if (tree[node << 1 | 1] % x != 0 and tree[node << 1] % x != 0) {
      allowed += 2;
      return;
    }
    if (tree[node << 1] % x != 0) {
      long long mid = (start + end) / 2;
      query(node << 1, start, mid, l, r, x);
    } else {
      long long mid = (start + end) >> 1;
      query(node << 1 | 1, mid + 1, end, l, r, x);
    }
    return;
  }
  if (l <= start and end <= r and start == end) {
    if (tree[node] % x == 0) return;
    allowed += 1;
    return;
  }
  long long mid = (start + end) / 2;
  query(2 * node, start, mid, l, r, x);
  query(2 * node + 1, mid + 1, end, l, r, x);
  return;
}
void update(long long node, long long start, long long end, long long index,
            long long val) {
  if (start == end) {
    tree[node] = val;
    return;
  }
  long long mid = (start + end) / 2;
  if (index >= start and index <= mid) {
    update(2 * node, start, mid, index, val);
  } else {
    update(2 * node + 1, mid + 1, end, index, val);
  }
  tree[node] = gcd(tree[2 * node], tree[2 * node + 1]);
}
void build(long long node, long long start, long long end) {
  if (start == end) {
    tree[node] = a[start];
    return;
  }
  long long mid = (start + end) / 2;
  build(2 * node, start, mid);
  build(2 * node + 1, mid + 1, end);
  tree[node] = gcd(tree[2 * node], tree[2 * node + 1]);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  build(1, 0, n - 1);
  long long q;
  cin >> q;
  ;
  while (q--) {
    long long type;
    cin >> type;
    if (type == 1) {
      long long l, r, x;
      cin >> l >> r >> x;
      allowed = 0;
      query(1, 0, n - 1, l - 1, r - 1, x);
      if (allowed <= 1)
        cout << "YES\n";
      else
        cout << "NO\n";
    } else {
      long long i, y;
      cin >> i >> y;
      update(1, 0, n - 1, i - 1, y);
    }
  }
}
