import sequtils,strutils,math,algorithm var N = stdin.readline.parseInt A = stdin.readline.split.map(parseInt) primes = newSeq[int](0) isnotprime : array[2005, bool] S : array[350, array[-1..100005, int]] for i in 2..2000: if isnotprime[i]: continue var j = i * 2 while j <= 2000: isnotprime[j] = true j += i primes.add(i) var Q = stdin.readline.parseInt P,L,R : int for i,a in A: var k = a for j,p in primes: S[j][i] = S[j][i - 1] if a == 0: S[j][i] += 300 continue while k mod p == 0: S[j][i] += 1 k = k div p for q in 0.. 1: f = false if s[300] >= 300: f = true if f: echo "Yes" else: echo "NO"