#include using namespace std; #define ll long long #define MOD 1000000007 #define INF 1e18 #define pi pair ll arr[100010]; ll bit[100010]; ll tem[100010]; ll n; void update(ll x, ll val) { for(; x <= n; x += x&-x) bit[x] = (bit[x]+val+MOD)%MOD; } ll query(ll x) { ll sum = 0; for(; x > 0; x -= x&-x) sum =(sum+ bit[x]+MOD)%MOD; return sum; } ll power(ll x, ll y, ll p) { ll res = 1; // Initialize result x = x % p; // Update x if it is more than or // equal to p while (y > 0) { // If y is odd, multiply x with result if (y & 1) res = (res*x) % p; // y must be even now y = y>>1; // y = y/2 x = (x*x) % p; } return res; } int main() { ll a,b,q; cin>>n>>a>>b>>q; ll val=-b*(power(a,MOD-2,MOD)); // cout<>arr[i]; } ll type,l,r; for(int i=1;i<=n;i++) { tem[i]=(arr[i]*power(val,i-1,MOD))%MOD; update(i,tem[i]); } while(q--) { cin>>type; if(type==1) { cin>>l>>r; l++; update(l,-tem[l]); arr[l]=r; tem[l]=(arr[l]*power(val,l-1,MOD))%MOD; update(l,tem[l]); } else { cin>>l>>r; l++;r++; if(l==r || val==0) { if(arr[l]!=0) { cout<<"No"<