#include using namespace std; using LL=long long; using ULL=unsigned long long; #define rep(i,n) for(int i=0; i<(n); i++) const ULL M=1000000007; ULL C[128]={}; ULL powM2[200001]; ULL powMI2[200001]; ULL ans=0; string S; int N; int main(){ cin>>S; N=S.size(); powM2[0]=powMI2[0]=1; rep(i,N) powM2[i+1]=powM2[i]*2%M; rep(i,N) powMI2[i+1]=powMI2[i]*500000004%M; rep(i,N){ char c=S[i]; ans = ans*2%M; ans = (ans+powM2[i]+M-C[c])%M; C[c]=(C[c]+powM2[i])%M; } cout<