import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); char[] s = br.readLine().toCharArray(); br.close(); int mod = 1000000007; int n = s.length; long[][] dpn = new long[n + 1][26]; long[][] dpc = new long[n + 1][26]; for (int i = 0; i < n; i++) { int d = s[i] - 'a'; for (int j = 0; j < 26; j++) { if (j == d) { dpn[i + 1][j] += dpn[i][j] * 2 + 1; dpc[i + 1][j] += dpc[i][j] * 2 + 1; } else { dpn[i + 1][j] = dpn[i][j]; dpc[i + 1][j] = dpc[i][j]; dpn[i + 1][d] += dpn[i][j]; dpc[i + 1][d] += dpc[i][j] + dpn[i][j]; } } for (int j = 0; j < 26; j++) { dpn[i + 1][j] %= mod; dpc[i + 1][j] %= mod; } } long ans = 0; for (int j = 0; j < 26; j++) { ans += dpc[n][j]; } ans %= mod; System.out.println(ans); } }