#include #define lli long long int using namespace std; const lli MOD = 1000000007; char rawString[100001]; lli str[100001]; lli pow(lli base, lli exp){ if(base == 0) return 0; else if(base == 1) return 1; else if(exp == 0) return 1; else if(exp == 1) return base; else if(exp % 2 == 0) return pow((base*base)%MOD, exp/2)%MOD; else if(exp % 2 == 1) return ((pow((base*base)%MOD, exp/2)%MOD)*base)%MOD; else return 1; } int main(){ lli n, q; cin >> n >> q; cin >> rawString; for(lli i = 0;i < n ;i++) str[i] = rawString[i] - 'a'; for(lli i = 0;i < q;i++){ lli qt, qi, qj; cin >> qt >> qi >> qj; if(qt == 1){ lli t; cin >> t; for(lli i = qi; i <= qj ;i++) str[i] = (str[i] + t)%26; } else{ lli ans = 1, nonZero = 1; lli freq[26] = {0}; for(lli i = qi; i <= qj; i++) freq[str[i]]++; for(lli i = 0;i < 26;i++) ans = (ans*pow(2, freq[i] - 1))%MOD; for(lli i = 0;i < 26;i++) if(freq[i] != 0) nonZero++; cout << (ans*nonZero - 1)%MOD << endl; } } }