human
Bash likes playing with arrays. He has an array a1, a2, ... an of n integers. He likes to guess the greatest common divisor (gcd) of different segments of the array. Of course, sometimes the guess is not correct. However, Bash will be satisfied if his guess is almost correct.

Suppose he guesses that the gcd of the elements in the range [l, r] of a is x. He considers the guess to be almost correct if he can change at most one element in the segment such that the gcd of the segment is x after making the change. Note that when he guesses, he doesn't actually change the array — he just wonders if the gcd of the segment can be made x. Apart from this, he also sometimes makes changes to the array itself.

Since he can't figure it out himself, Bash wants you to tell him which of his guesses are almost correct. Formally, you have to process q queries of one of the following forms:

  * 1 l r x — Bash guesses that the gcd of the range [l, r] is x. Report if this guess is almost correct. 
  * 2 i y — Bash sets ai to y. 


Note: The array is 1-indexed.

Input

The first line contains an integer n (1 ≤ n ≤ 5·105) — the size of the array.

The second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 109) — the elements of the array.

The third line contains an integer q (1 ≤ q ≤ 4·105) — the number of queries.

The next q lines describe the queries and may have one of the following forms:

  * 1 l r x (1 ≤ l ≤ r ≤ n, 1 ≤ x ≤ 109). 
  * 2 i y (1 ≤ i ≤ n, 1 ≤ y ≤ 109). 


Guaranteed, that there is at least one query of first type.

Output

For each query of first type, output "YES" (without quotes) if Bash's guess is almost correct and "NO" (without quotes) otherwise.

Examples

Input

3
2 6 3
4
1 1 2 2
1 1 3 3
2 1 9
1 1 3 2

Output

YES
YES
NO

Input

5
1 2 3 4 5
6
1 1 4 2
2 3 6
1 1 4 2
1 1 5 2
2 5 10
1 1 5 2

Output

NO
YES
NO
YES

Note

In the first sample, the array initially is {2, 6, 3}. 

For query 1, the first two numbers already have their gcd as 2.

For query 2, we can achieve a gcd of 3 by changing the...
The above is tricky. Write me a correct solution in PYTHON.

=====
Give me a the Python program you requested?
assistant
#Here is the Python program you requested.

#!/usr/bin/env python2
"""
This file is part of https://github.com/cheran-senthil/PyRival
Copyright 2019 Cheran Senthilkumar <hello@cheran.io>

"""
from __future__ import division, print_function

import itertools
import os
import sys
from atexit import register
from io import BytesIO

class dict(dict):
    """dict() -> new empty dictionary"""

    def items(self):
        """D.items() -> a set-like object providing a view on D's items"""
        return dict.iteritems(self)

    def keys(self):
        """D.keys() -> a set-like object providing a view on D's keys"""
        return dict.iterkeys(self)

    def values(self):
        """D.values() -> an object providing a view on D's values"""
        return dict.itervalues(self)

def gcd(x, y):
    """greatest common divisor of x and y"""
    while y:
        x, y = y, x % y
    return x

range = xrange

filter = itertools.ifilter
map = itertools.imap
zip = itertools.izip

sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
sys.stdout = BytesIO()
register(lambda: os.write(1, sys.stdout.getvalue()))

input = lambda: sys.stdin.readline().rstrip('\r\n')

def main():
    n = int(input())
    arr = [int(num) for num in input().split()]

    a = [0] * (524288 << 1 | 1)
    for i in range(n):
        p = i + 524289
        a[p] = arr[i]
        while p != 1:
            p >>= 1
            a[p] = gcd(a[p << 1], a[p << 1 | 1])

    q = int(input())
    for _ in range(q):
        query = [int(num) for num in input().split()]

        if query[0] == 1:
            p = 524288 + query[1]

            while p != 1 and (a[p] % query[3] == 0):
                if p & (p + 1) == 0:
                    p = n + 524289
                    break
                p = (p + 1) >> 1

            while p < 524288:
                p <<= 1
                p += int(a[p] % query[3] == 0)

            if p - 524288 >= query[2]:
                print('YES')
            else:
                p += 1
                while p != 1 and (a[p] % query[3] == 0):
                    if p & (p + 1)...