import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.Scanner;
public class Main {
public static void main(String[] args) { //remove comments before upload
Scanner input = new Scanner(System.in);
String msg = input.nextLine(); //msg
ArrayList<String> solutions = new ArrayList<>();
ArrayList<String> process = new ArrayList<>();
boolean done = false;
//System.out.println("processing msg: " + msg);
process.add(msg);
if(msg.length() == 1) {
solutions.add(msg);
done = true;
}
while(!done) {
done = true;
ArrayList<String> newprocess = new ArrayList<>();
for(String proc : process) {
//System.out.println("processing possible: " + proc);
for(int b = 0; b < proc.length()-1 ; b++) {
//System.out.println("b " + proc.substring(b, b+1) + " b1 " + proc.substring(b+1, b+2));
if(!proc.substring(b, b+1).contains(",") && !proc.substring(b+1, b+2).contains(",")) {
String ns = proc.substring(0, b+1) + "," + proc.substring(b+1, proc.length());
//System.out.println("trying: " + ns);
if(!process.contains(ns) && !solutions.contains(ns)) {
boolean valid = true;
for(String s : ns.split(",")) {
ArrayList<String> letters = new ArrayList<>();
for(int l = 0; l < s.length() ; l++) {
String letter = s.substring(l,l+1);
if(!letters.contains(letter)) {
letters.add(letter);
}else {
valid = false;
}
}
}
if(valid) {
//System.out.println("valid: " + ns);
newprocess.add(ns);
solutions.add(ns);
done = false;
} else {
newprocess.add(ns); //way more inefficient, goes through everything until its all , but fixes some issues
//System.out.println("invalid: " + ns);
}
}
}
}
}
process = newprocess;
}
int extra = solutions.size()%10000007;
//System.out.println("done, solution count: " + solutions.size());
System.out.println(extra);
input.close();
}
}