#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define ll long long
ll ans = 0;
vector<ll> cache;
string line;
ll calc(ll startOffset){
ll fnd[25] = {0};
bool brk = false;
ll tmpAns = 0;
for (ll i = startOffset; i < line.length(); ++i) {
fnd[line[i]-97]++;
if(fnd[line[i]-97] > 1) {
brk = true;
break;
}
if(cache[i] == -1ll){
ll tmpAns2 = calc(i+1);
tmpAns += tmpAns2;
cache[i] = tmpAns2;
}else{
tmpAns += cache[i];
}
}
if(!brk){
++tmpAns;
}
return tmpAns;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nllptr);
std::getline(std::cin, line);
cache = vector<ll>(line.length() + 1, -1);
ans += calc(0);
cout << (ans/2) % (1000000000 + 7);
cout << '\n';
flush(std::cout);
}