#!/bin/python3 import sys n,q = input().strip().split(' ') n,q = [int(n),int(q)] s = input().strip() sa = [ord(i) - ord('a') for i in s] for a0 in range(q): qu = input().strip().split(' ') if int(qu[0]) == 1: start = int(qu[1]) end =int(qu[2]) t = int(qu[3]) for i in range(start, end + 1): sa[i] = (sa[i] + t) % 26 else: start = int(qu[1]) end =int(qu[2]) d = [0] * 27 for i in range(start, end + 1): d[sa[i]] += 1 ans = 1 for i in range(27): if d[i]: ans = (ans * pow(2, d[i] - 1) )% 1000000007 g = ans ans = (ans - 1 )% 1000000007 for i in range(27): if d[i]: ans = (ans + g) % 1000000007 print(ans)