#include using namespace std; typedef long long ll; typedef pair P; #define REP(i,n) for(ll i=0;i> n >> q >> k; ll kM=k%MOD,km=k%mod; ll eM=1,em=1; for(i=1;i<=n;i++){ ll a; cin >> a; ll AM=a%MOD,am=a%mod; M[i]=(AM*eM)%MOD; m[i]=(am*em)%mod; eM*=kM; eM%=MOD; em*=km; em%=MOD; } for(i=1;i<=n;i++){ M[i]+=M[i-1]; M[i]%=MOD; m[i]+=m[i-1]; m[i]%=mod; } while(q--){ ll l,r; cin >> l >> r; if((M[r]-M[l-1]+MOD)%MOD==0 && (m[r]-m[l-1]+mod)%mod==0) cout << "No" << endl; else cout << "Yes" << endl; } return 0; }