#include <bits/stdc++.h>
using namespace std;
void setIO(const string& name = "") {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  if (name.length()) {
    freopen((name + ".in").c_str(), "r", stdin);
    freopen((name + ".out").c_str(), "w", stdout);
  }
}
template <typename T>
void read(vector<T>& a) {
  for (auto& x : a) cin >> x;
}
template <typename T>
void read(vector<T>& a, long long n) {
  a.resize(n);
  for (auto& x : a) cin >> x;
}
template <class T, class U>
ostream& operator<<(ostream& out, const pair<T, U>& v) {
  out << "(";
  out << v.first << "," << v.second;
  return out << ")";
}
template <class T>
ostream& operator<<(ostream& out, const vector<T>& v) {
  out << "[";
  for (auto(i) = 0; (i) < ((long long)(v).size()); (i)++) {
    if (i) out << ", ";
    out << v[i];
  }
  return out << "]";
}
template <typename T>
void print(vector<T>& a) {
  for (const auto& x : a) cout << x << ' ';
  cout << '\n';
}
void MOD(long long& x, long long m = 1000000007) {
  x %= m;
  if (x < 0) x += m;
}
template <typename T>
void dbg(const char* name, T&& arg1) {
  cout << name << " : " << arg1 << '\n';
}
template <typename T, typename... U>
void dbg(const char* names, T&& arg1, U&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  dbg(comma + 1, args...);
}
template <class T>
void read(T& x) {
  cin >> x;
}
template <class T, class... U>
void read(T& t, U&... u) {
  read(t);
  read(u...);
}
long long gcd(long long a, long long b) { return !a ? b : gcd(b % a, a); }
struct SegTree {
  long long size = 1;
  vector<long long> elements;
  void init(long long n) {
    while (size < n) size *= 2;
    elements.assign(2 * size, 0);
  }
  void build(const vector<long long>& a, long long x, long long lx,
             long long rx) {
    if (lx + 1 == rx) {
      if (lx < (long long)(a).size()) {
        elements[x] = a[lx];
      }
      return;
    }
    long long mid = (lx + rx) / 2;
    build(a, 2 * x + 1, lx, mid);
    build(a, 2 * x + 2, mid, rx);
    elements[x] = gcd(elements[2 * x + 1], elements[2 * x + 2]);
  }
  void build(const vector<long long>& a) { build(a, 0, 0, size); }
  void set(long long i, long long v, long long x, long long lx, long long rx) {
    if (lx + 1 == rx) {
      elements[x] = v;
      return;
    }
    long long mid = (lx + rx) / 2;
    if (i < mid) {
      set(i, v, 2 * x + 1, lx, mid);
    } else {
      set(i, v, 2 * x + 2, mid, rx);
    }
    elements[x] = gcd(elements[2 * x + 1], elements[2 * x + 2]);
  }
  void set(long long i, long long v) { set(i, v, 0, 0, size); }
  long long find(long long l, long long r, long long v, long long x,
                 long long lx, long long rx) {
    if (lx >= r or rx <= l) return 0;
    if (l <= lx and rx <= r) {
      return elements[x] % v != 0;
    }
    long long mid = (lx + rx) / 2;
    long long r1 = find(l, r, v, 2 * x + 1, lx, mid);
    long long r2 = find(l, r, v, 2 * x + 2, mid, rx);
    return (r1 + r2);
  }
  pair<long long, long long> invalid_r;
  long long invalid = -1;
  bool found = false;
  void find_p(long long l, long long r, long long v, long long x, long long lx,
              long long rx) {
    if (lx >= r or rx <= l) return;
    if (l <= lx and rx <= r) {
      if (elements[x] % v != 0) {
        invalid = x;
        invalid_r = make_pair(lx, rx);
        found = true;
      }
      return;
    }
    if (found) return;
    long long mid = (lx + rx) / 2;
    find_p(l, r, v, 2 * x + 1, lx, mid);
    if (found) return;
    find_p(l, r, v, 2 * x + 2, mid, rx);
  }
  long long check_range(long long lx, long long rx, long long x, long long v) {
    if (rx - lx == 1) {
      return elements[x] % v != 0;
    }
    long long mid = (lx + rx) / 2;
    if (elements[2 * x + 1] % v != 0 and elements[2 * x + 2] % v != 0)
      return 2;
    else if (elements[2 * x + 1] % v != 0) {
      return check_range(lx, mid, 2 * x + 1, v);
    } else if (elements[2 * x + 2] % v != 0) {
      return check_range(mid, rx, 2 * x + 2, v);
    } else {
      return 0;
    }
  }
  bool find(long long l, long long r, long long v) {
    found = false;
    long long res = find(l, r, v, 0, 0, size);
    if (res > 1) return false;
    if (res == 0) return true;
    find_p(l, r, v, 0, 0, size);
    long long num = check_range(invalid_r.first, invalid_r.second, invalid, v);
    return (num <= 1);
  }
};
long long n, q;
vector<long long> a;
int32_t main() {
  setIO();
  read(n);
  read(a, n);
  read(q);
  SegTree st;
  st.init(n);
  st.build(a);
  while (q--) {
    long long op;
    cin >> op;
    if (op == 1) {
      long long l, r, x;
      read(l, r, x);
      --l;
      cout << ((st.find(l, r, x)) ? "YES" : "NO") << '\n';
    } else {
      long long i, y;
      read(i, y);
      --i;
      st.set(i, y);
    }
  }
  return 0;
}
