#include #include using namespace std; int main (){ vector machines; unsigned long long days; cin >> days; unsigned long long fragment; for(unsigned long long i = 0; i < days; i++){ cin >> fragment; machines.push_back(fragment); } unsigned long long queries = 0; cin >> queries; unsigned long long from = 0; unsigned long long to = 0; unsigned long long pieces = 0; for (unsigned long long i = 0; i < queries; i++){ cin >> from >> to >> pieces; unsigned long long meteor = 1; for (unsigned long long j = from; j <(from+ (to-from+1)); j++){ if (machines[j-1]!=0){ meteor*= machines[j-1];} } // cout << meteor << endl; if (meteor%pieces == 0){ cout << "Yes" << endl; } else{ cout << "No" << endl; } } return 0; }