#include typedef long long ll; const int N = 1 << 17, D = 2 * N + 10, mod = 1e9 + 7; int n, m, t[D][26], p[D], res[26]; char s[N]; ll l[26], r[26], d[N], dr[N]; void lp(int i) { p[i] %= 26; if (!p[i]) return; if (i < N) p[i << 1] += p[i], p[i << 1 | 1] += p[i]; for (int j = 0; j < 26; j++) res[(j + p[i]) % 26] = t[i][j]; for (int j = 0; j < 26; j++) t[i][j] = res[j]; p[i] = 0; } void upd(int l, int r, int L, int R, int i, int v) { if (l > R || r < L) return; if (l >= L && r <= R) { p[i] += v; lp(i); return; } lp(i); int m = l + r >> 1; upd(l, m, L, R, i << 1, v); upd(m + 1, r, L, R, i << 1 | 1, v); for (int j = 0; j < 26; j++) t[i][j] = t[i << 1][j] + t[i << 1 | 1][j]; } void get(int l, int r, int L, int R, int i) { if (l > R || r < L) return; if (l >= L && r <= R) { lp(i); for (int j = 0; j < 26; j++) res[j] += t[i][j]; return; } lp(i); int m = l + r >> 1; get(l, m, L, R, i << 1); get(m + 1, r, L, R, i << 1 | 1); } int main() { scanf("%d %d %s", &n, &m, s + 1); for (int i = N; i < N + n; i++) t[i][s[i - N + 1] - 'a'] = 1; for (int i = N - 1; i; i--) for (int j = 0; j < 26; j++) t[i][j] = t[i << 1][j] + t[i << 1 | 1][j]; dr[1] = d[1] = d[0] = 1; for (int i = 2; i <= n + 1; i++) dr[i] = d[i] = d[i - 1] * 2 % mod; while (m--) { int k, x, y, rr; scanf("%d %d %d", &k, &x, &y); x++; y++; if (k == 1) { scanf("%d", &rr); upd(1, N, x, y, 1, rr); } else { for (int i = 0; i < 26; i++) res[i] = 0; get(1, N, x, y, 1); ll z = 1, g = 0; for (int i = 0; i < 26; i++) l[i] = z = (z * d[res[i]]) % mod; z = 1; for (int i = 25; i >= 0; i--) r[i] = z = (z * d[res[i]]) % mod; for (int i = 1; i < 25; i++) g = (g + l[i - 1] * r[i + 1] % mod * dr[res[i]] % mod) % mod; g = (g + z + r[1] * dr[res[0]] % mod + l[24] * dr[res[25]] % mod - 1) % mod; if (g < 0) g += mod; printf("%lld\n", g); } } return 0; }