import java.util.*; public class Main { static final int MOD = 1000000007; public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); ArrayList> counts = new ArrayList<>(); for (int i = 0; i < 26; i++) { counts.add(new HashMap<>()); } for (char c : sc.next().toCharArray()) { int idx = c - 'a'; for (int x : counts.get(idx).keySet()) { counts.get(idx).put(x, counts.get(idx).get(x) * 2 % MOD); } counts.get(idx).put(1, counts.get(idx).getOrDefault(1, 0) + 1); for (int i = 0; i < 26; i++) { if (idx == i) { continue; } for (int x : counts.get(i).keySet()) { counts.get(idx).put(x + 1, (counts.get(idx).getOrDefault(x + 1, 0) + counts.get(i).get(x)) % MOD); } } } long ans = 0; for (HashMap map : counts) { for (Map.Entry entry : map.entrySet()) { ans += (long)(entry.getKey().intValue()) * entry.getValue() % MOD; ans %= MOD; } } System.out.println(ans); } }