a = [ord(i)-ord("a") for i in input()] mod = 10**9+7 n = len(a) count = [0]*26 two = [1] for i in range(n): two.append(two[-1]*2%mod) ans = 0 for i in range(n): ans += ((two[i]-count[a[i]])*two[n-1-i])%mod ans %= mod count[a[i]] += two[i] count[a[i]] %= mod print(ans)