#include using namespace std; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b; using graph = vector>; const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; const ll INF = 1LL<<60; const ll mod = 1000000007LL; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { string S; cin>>S; ll N = S.size(); vector> dp(N+1,vector(26,0LL)),dpp(N+1,vector(26,0LL)); rep(i,N){ int t = S[i] - 'a'; rep(j,26) dp[i+1][j]=dp[i][j]; rep(j,26) { if(j!=t) dp[i+1][t]=(dp[i+1][t]+dp[i][j]+dpp[i][j])%mod; if(j==t) dp[i+1][t]=(dp[i+1][t]+dp[i][j])%mod; } rep(j,26){ dpp[i+1][j]=(dpp[i+1][j]+dpp[i][j])%mod; dpp[i+1][t]=(dpp[i+1][t]+dpp[i][j])%mod; } dp[i+1][t]=(dp[i+1][t]+1)%mod; dpp[i+1][t]=(dpp[i+1][t]+1)%mod; } ll ans = 0; rep(i,26) ans = (ans+dp[N][i])%mod; cout<