def gcd(a, b):
    if a < b:
        a, b = b, a
    while b != 0:
        a, b = b, a % b
    return a


def main():
    cuters = int(input())
    machines = list(map(lambda i: int(i), input().split(" ")))
    query = int(input())
    for i in range(query):
        start, end, need = map(lambda t: int(t), input().split(" "))
        for j in range(start-1, end):
            temp = gcd(need, machines[j])
            need //= temp
            if need == 1:
                print("Yes")
                break
        else:
            print("No")

main()


