import sys input = sys.stdin.readline S = input()[:-1] N = len(S) sub = [0]*26 ans = 0 MOD = 10**9+7 for i in range(N): j = ord(S[i])-ord('a') ans += (pow(2, i, MOD)-sub[j])*pow(2, N-1-i, MOD) ans %= MOD sub[j] += pow(2, i, MOD) sub[j] %= MOD print(ans)