# Assertion A = [ord(a) - 97 for a in input()] N = len(A) for a in A: assert 0 <= a < 26 assert 1 <= N <= 2 * 10 ** 5 P = 10 ** 9 + 7 X = [0] * 26 po2 = [1] for _ in range(N): po2.append(po2[-1] * 2 % P) ans = 0 for i, a in enumerate(A): ans = (ans + (po2[i] - X[a]) * po2[N-i-1]) % P X[a] = (X[a] + po2[i]) % P print(ans)