#include <bits/stdc++.h>
using namespace std;
const long long int N = 5e5 + 10;
long long int seg[4 * N], a[N], cnt;
long long int gcd(long long int a, long long int b) {
  if (a == 0)
    return b;
  else
    return gcd(b % a, a);
}
void construct_tree(long long int low, long long int high, long long int pos) {
  long long int mid;
  if (low == high) {
    seg[pos] = a[low];
    return;
  }
  mid = (low + high) / 2;
  construct_tree(low, mid, 2 * pos + 1);
  construct_tree(mid + 1, high, 2 * pos + 2);
  seg[pos] = gcd(seg[2 * pos + 1], seg[2 * pos + 2]);
}
void rangeQuery(long long int qlow, long long int qhigh, long long int low,
                long long int high, long long int pos, long long int g) {
  if (cnt >= 2) return;
  long long int mid = (low + high) / 2;
  if (qlow <= low && qhigh >= high) {
    if ((seg[pos] % g) == 0) return;
    if (low == high) {
      if ((seg[pos] % g) != 0) cnt++;
      return;
    }
    if ((seg[2 * pos + 1] % g) != 0)
      rangeQuery(qlow, qhigh, low, mid, 2 * pos + 1, g);
    if ((seg[2 * pos + 2] % g) != 0)
      rangeQuery(qlow, qhigh, mid + 1, high, 2 * pos + 2, g);
    return;
  }
  if (qlow > high || qhigh < low) {
    return;
  }
  rangeQuery(qlow, qhigh, low, mid, 2 * pos + 1, g);
  rangeQuery(qlow, qhigh, mid + 1, high, 2 * pos + 2, g);
  return;
}
void update(long long int qlow, long long int qhigh, long long int low,
            long long int high, long long int val, long long int pos) {
  if (qlow <= low && qhigh >= high) {
    seg[pos] = val;
    return;
  }
  if (qlow > high || qhigh < low) {
    return;
  }
  long long int mid = (low + high) / 2;
  update(qlow, qhigh, low, mid, val, 2 * pos + 1);
  update(qlow, qhigh, mid + 1, high, val, 2 * pos + 2);
  seg[pos] = gcd(seg[2 * pos + 1], seg[2 * pos + 2]);
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int i, q, n, type;
  cin >> n;
  for (i = 0; i <= n - 1; i++) cin >> a[i];
  construct_tree(0, n - 1, 0);
  cin >> q;
  while (q--) {
    cin >> type;
    if (type == 1) {
      long long int l, r, g;
      cin >> l >> r >> g;
      cnt = 0;
      l--;
      r--;
      rangeQuery(l, r, 0, n - 1, 0, g);
      if (cnt <= 1)
        cout << "YES"
             << "\n";
      else
        cout << "NO"
             << "\n";
    } else {
      long long int ind, val;
      cin >> ind >> val;
      ind--;
      update(ind, ind, 0, n - 1, val, 0);
    }
  }
  return 0;
}
