#include <iostream>
#include <math.h>
#include <vector>
#include <algorithm>
using namespace std;
const int charCount = 26;
int toInt(char c) {
return (int) c - 97;
}
vector<bool> toBinary(long n) {
vector<bool> r;
while(n != 0) {
r.push_back(n % 2 != 0);
n /= 2;
}
return r;
}
unsigned long all(unsigned long len) {
if (len < 0) len = 0;
unsigned long res = 1;
for (unsigned long i = 0; i < len; i++) {
res *= 2;
}
return res;
}
unsigned long isValid(string value, unsigned long parts) {
vector<bool> binary = toBinary(parts);
bool chars [charCount];
fill_n(chars, charCount, false);
chars[toInt(value[0])] = true;
for (unsigned long i = 1; i < value.length(); i++) {
if (i - 1 < binary.size() && binary[i - 1]) {
fill_n(chars, charCount, false);
}
int c = toInt(value[i]);
if (chars[c]) {
return false;
}
chars[c] = true;
}
return true;
}
unsigned long solve(string value) {
unsigned long res = 0, n = pow((long) 2, value.length() -1);
//cout << "Length " << n << endl;
for (unsigned long i = 0; i < n; i++) {
bool valid = isValid(value, i);
if (valid) {
res++;
}
//cout << value << (valid ? " Valid":"") << endl;
vector<bool> bin = toBinary(i);
for (unsigned long j = 0; j + 1 < value.length(); j++) {
if (j >= bin.size()) {
//cout << ",";
continue;
}
//cout << (bin.at(j) ? "|" : ".");
}
//cout << endl;
}
return res;
}
int main() {
string str;
cin >> str;
cout << solve(str) % (1000000000 + 7);
}