N=int(input()) A=list(map(int,input().split())) Q=int(input()) Query=[list(map(int,input().split())) for i in range(Q)] import math from itertools import accumulate B=[math.log(a) for a in A] S=[0]+list(accumulate(B)) for p,l,r in Query: #print(S[r]-S[l-1],round(pow(math.e,S[r]-S[l-1]))) if round(pow(math.e,S[r]-S[l-1]))%p==0: print("Yes") else: print("No")