mod = 10**9+7 def main(): S = str(input()) S = [ord(c)-ord('a') for c in S] n = len(S) dp = [[0, 0] for i in range(26)] ans = 0 for i, c in enumerate(S): if i == 0: dp[c][0] = 1 dp[c][1] = 1 continue nx = [[0, 0] for j in range(26)] nx[c][0] = 1 nx[c][1] = 1 for j in range(26): nx[j][0] += dp[j][0] nx[j][0] %= mod nx[j][1] += dp[j][1] nx[j][1] %= mod for j in range(26): if j == c: nx[j][0] += dp[j][0] nx[j][0] %= mod nx[j][1] += dp[j][1] nx[j][1] %= mod else: nx[c][0] += dp[j][0] nx[c][0] %= mod nx[c][1] += dp[j][0]+dp[j][1] nx[c][1] %= mod dp = nx ans = 0 for j in range(26): ans += dp[j][1] ans %= mod print(ans) if __name__ == '__main__': main()