#include using namespace std; main(){ int n; cin >> n; long long int a[n+1],b[n+1]; a[0]=1; b[0]=1; for(int i=1;i<=n;i++){ cin >> a[i]; b[i]=b[i-1]*a[i]; } int q; cin >> q; int p,l,r; for(int i=0;i> p >> l >> r; if( (b[r]/b[l-1])%p==0 ){ cout << "Yes" <