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 double pi = acos(-1.0);
const double eps = 1e-9;
const int mod = 1e9 + 7;
const long long INF = 1e12 + 1;
const int N = 1e3 + 9;
string s;
int ans, san, cnt;
vector<int> v;
int main() {
  cin >> s;
  int q = 0;
  for (int i = 0; i < s.size(); ++i) {
    if (s[i] == 'a') cnt++;
  }
  s[s.size()] = 'b';
  for (int i = 0; i <= s.size(); ++i) {
    if (s[i] == 'a')
      san++;
    else if (s[i] == 'b' && san > 0) {
      v.push_back(san);
      san = 0;
    }
  }
  for (int i = 1; i < v.size(); ++i) {
    cnt += v[i] * v[i - 1];
  }
  cout << cnt % mod;
  exit(0);
}
