//The best is yet to come... #include #include using namespace std; #define ll long long int #define inf 1000000000000 #define mod 1000000007 #define pb push_back #define mp make_pair #define all(v) v.begin(),v.end() #define S second #define F first #define boost1 ios::sync_with_stdio(false); #define boost2 cin.tie(0); #define mem(a,val) memset(a,val,sizeof a) #define endl "\n" #define maxn 100001 ll arr[maxn],tree[4*maxn],power[maxn],c[maxn]; ll bpow(ll x,ll n) { ll ans=1; while(n>0) { if(n&1) ans*=x; x*=x; ans%=mod; x%=mod; n/=2; } return ans; } void build(int node,int a,int b) { if(a==b) { tree[node]=arr[a]; return; } int mid=(a+b)/2; build(2*node,a,mid); build(2*node+1,mid+1,b); tree[node]=(tree[2*node]+tree[2*node+1])%mod; } void update(int node,int a,int b,int ind,ll val) { if(a>b || a>ind | bb || a>r || b=l && b<=r) return tree[node]; int mid=(a+b)/2; return (query(2*node,a,mid,l,r)+query(2*node+1,mid+1,b,l,r))%mod; } int main() { boost1;boost2; ll a,q,b,type,l,r,ind,val,x,y,at,n,i,j; cin>>n>>a>>b>>q; for(i=0;i<=n-1;i++) cin>>c[i]; at=(((mod-b)%mod)*(bpow(a,mod-2)))%mod; power[0]=1; for(i=1;i<=n;i++) power[i]=(power[i-1]*at)%mod; // cout<>type; if(type==1) { cin>>ind>>val; update(1,0,n-1,ind,val); c[ind]=val%mod; } else { cin>>l>>r; x=query(1,0,n-1,l,r); x=(x*bpow(power[l],mod-2))%mod; if(b==0) { if(c[l]!=0) { cout<<"No"<