from itertools import accumulate as c;input();a=[0]+list(c(list(map(int,input().split())))) for i in range(int(input())): p,l,r=map(int,input().split()) if (a[r]-a[l-1])%p==0:print("Yes") else:print("NO")