#include <stdio.h>
#include <stdint.h>
uint64_t getNumCombinations(char *str, uint32_t size, uint32_t previousIndx) {
if(previousIndx + 1 >= size) return 1;
uint64_t count;
uint32_t chrCount[26];
uint8_t chrIndex;
for(uint8_t i = 0; i < 26; i++) chrCount[i] = 0;
count = 0;
for(uint32_t i = previousIndx + 1; i < size; i++) {
chrIndex = str[i - 1] - 'a';
chrCount[chrIndex]++;
if(chrCount[chrIndex] > 1) return count;
count += getNumCombinations(str, size, i) % 1000000007;
count %= 1000000007;
}
if(chrCount[str[size - 1] - 'a'] == 0) count++;
return count % 1000000007;
}
#define MAX_CALLS 50000
uint64_t getNumCombinationsIterative(char *str, uint32_t strLength) {
uint64_t count;
uint8_t chrIndex;
uint32_t chrCount[MAX_CALLS][26];
uint32_t indxStack[MAX_CALLS];
int64_t stackTop;
// Initialize stacks
stackTop = 0;
for(uint8_t i = 0; i < 26; i++) chrCount[stackTop][i] = 0;
indxStack[stackTop] = 1;
count = 0;
while(stackTop >= 0) {
if(indxStack[stackTop] == strLength) {
if(chrCount[stackTop][str[strLength - 1] - 'a'] == 0) count++;
count %= 1000000007;
stackTop--;
continue;
}
// Increment chrCount[stackTop][chrIndex]
chrIndex = str[indxStack[stackTop] - 1] - 'a';
chrCount[stackTop][chrIndex]++;
// Quit if same character occurred twice in this stackTop
if(chrCount[stackTop][chrIndex] > 1) {
stackTop--;
break;
}
// Increment indxStack[indxStackTop] since next time should continue from next chr
indxStack[stackTop]++;
// If reached end of str, increment count
if(indxStack[stackTop] == strLength) {
count++;
count %= 1000000007;
}
// Otherwise, call recursively
else {
stackTop++;
for(uint8_t j = 0; j < 26; j++) chrCount[stackTop][j] = 0;
indxStack[stackTop] = indxStack[stackTop - 1];
}
}
return count;
}
int main() {
char str[1000001];
uint32_t strLength, i;
uint64_t combinationCount;
for(i = 0; i < 1000001; i++) str[i] = '\0';
scanf("%s", str);
for(i = 0; i < 1000000 && str[i] != '\0'; i++);
strLength = i;
//combinationCount = getNumCombinations(str, strLength, 0);
combinationCount = getNumCombinationsIterative(str, strLength);
printf("%lu", combinationCount);
return 0;
}