aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

#include <bits/stdc++.h>
using namespace std;
const int MX = 28, infi = 1000000, mod = 1000000007;
string s;
long long sol, n;
int dp[100005][3];
int rec(int ind, int las) {
  int &ret = dp[ind][las];
  if (ret != -1) return ret;
  if (ind == n - 1) {
    if (las == 0 && s[ind] == 'b') return 1;
    return 0;
  }
  ret = 0;
  if (s[ind] == 'b') ret++;
  if (s[ind + 1] != char(las + 'a'))
    ret = ((ret % mod) + (rec(ind + 1, 1 - las)) % mod) % mod;
  else
    ret = ((ret % mod) + (rec(ind + 1, las)) % mod) % mod;
  return dp[ind][las] = ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  n = s.size();
  memset(dp, -1, sizeof dp);
  for (int i = 0; i < n; i++)
    if (s[i] == 'a') sol += 1 + rec(i, 0);
  cout << sol % mod;
  return 0;
}
