#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T bigmod(T p, T e, T M) {
  long long ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  }
  return (T)ret;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T lcm(T a, T b) {
  return (a / gcd(a, b)) * b;
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
template <class T>
inline T bpow(T p, T e) {
  long long ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p);
    p = (p * p);
  }
  return (T)ret;
}
struct data {
  data() {}
  bool friend operator<(data a, data b) { return 0; }
};
int n, m, k;
long long N, M, K;
int ans = 0;
int st[3 * (int)1e6];
void update(int node, int s, int e, int id, int v) {
  if (s == e) {
    st[node] = v;
    return;
  }
  int mid = (s + e) / 2;
  if (id <= mid) {
    update(node * 2, s, mid, id, v);
  } else {
    update(node * 2 + 1, mid + 1, e, id, v);
  }
  st[node] = gcd(st[node * 2], st[node * 2 + 1]);
}
void query(int node, int s, int e, int l, int r, int x) {
  if (ans > 1) return;
  if (l == s && r == e) {
    if (st[node] % x == 0) return;
    if (ans == 0 && s == e) {
      ans = 1;
      return;
    }
    if (ans == 1) {
      ans = 2;
      return;
    }
  }
  int mid = (s + e) / 2;
  if (r <= mid) {
    query(node * 2, s, mid, l, r, x);
  } else if (l > mid) {
    query(node * 2 + 1, mid + 1, e, l, r, x);
  } else {
    query(node * 2, s, mid, l, mid, x);
    query(node * 2 + 1, mid + 1, e, mid + 1, r, x);
  }
}
int a[(int)1e6];
int main() {
  int t, tc = 1;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    update(1, 1, n, i, a[i]);
  }
  scanf("%d", &m);
  while (m--) {
    scanf("%d", &k);
    if (k == 1) {
      ans = 0;
      int l, r, x;
      scanf("%d %d %d", &l, &r, &x);
      query(1, 1, n, l, r, x);
      if (ans <= 1) {
        printf("YES\n");
      } else {
        printf("NO\n");
      }
    } else {
      int x, y;
      scanf("%d %d", &x, &y);
      update(1, 1, n, x, y);
    }
  }
  return 0;
}
