#include using namespace std; using ll = long long; using ld = long double; using vl = vector; template using vc = vector; template using vvc = vector>; #define eb emplace_back #define all(x) (x).begin(), (x).end() #define rep(i, n) for (ll i = 0; i < (n); i++) #define repr(i, n) for (ll i = (n)-1; i >= 0; i--) #define repe(i, l, r) for (ll i = (l); i < (r); i++) #define reper(i, l, r) for (ll i = (r)-1; i >= (l); i--) #define repa(i,n) for (auto& i: n) template inline bool chmax(T &a, const T &b) { if (a inline bool chmin(T &a, const T &b) { if (b void verr(const T& a, const N& n) { rep(i, n) cerr << a[i] << " "; cerr << "\n" << flush; } ll dbgt = 1; void err() { cerr << "passed " << dbgt++ << "\n" << flush; } template void err(H&& h,T&&... t){ cerr<< h << (sizeof...(t)?" ":"\n") << flush; if(sizeof...(t)>0) err(forward(t)...); } #endif const ll INF = 4e18; const ld EPS = 1e-11; const ld PI = acos(-1.0L); const ll MOD = 1e9 + 7; // const ll MOD = 998244353; //--------------------------------------------------------------------------------// pair dp[200005][30]; int main() { init(); string S; cin >> S; ll sn = S.size(); // fill(dp[0], dp[0] + 26, 1); rep(i, sn){ rep(j, 26) { if (S[i] - 'a' == j) { (dp[i + 1][j].first += 2 * dp[i][j].first + 1) %= MOD; (dp[i + 1][j].second += 2 * dp[i][j].second + 1) %= MOD; } else { // 選んだ (dp[i + 1][S[i] - 'a'].first += dp[i][j].first) %= MOD; (dp[i + 1][S[i] - 'a'].second += dp[i][j].first +dp[i][j].second) %= MOD; // 選ばない (dp[i + 1][j].first += dp[i][j].first) %= MOD; (dp[i + 1][j].second += dp[i][j].second) %= MOD; } } } // rep(i, sn + 1) rep(j, 26) cout << dp[i][j].second << (j == 25 ? '\n' : ' '); ll ans = 0; rep(i, 26)(ans += dp[sn][i].second) %= MOD; cout << ans << endl; }