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;
ostream& operator<<(ostream& os, const vector<long long>& a) {
  for (long long i = 0; i < a.size(); ++i) {
    os << a[i] << ' ';
  }
  return os;
}
bool comp(pair<long long, long long> a1, pair<long long, long long> a2) {
  return a1.first < a2.first;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s = "";
  cin >> s;
  vector<long long> a;
  vector<long long> sum;
  long long c = 0;
  for (long long i = 0; i < s.length(); ++i) {
    if (s[i] == 'a')
      c++;
    else if (s[i] == 'b') {
      if (c != 0) {
        a.push_back(c);
        sum.push_back(c);
        if (sum.size() != 1) sum[sum.size() - 1] += sum[sum.size() - 2];
        c = 0;
      }
    }
  }
  if (c != 0) {
    a.push_back(c);
    sum.push_back(c);
    if (sum.size() != 1) sum[sum.size() - 1] += sum[sum.size() - 2];
  }
  if (a.size() == 0) {
    cout << 0 << endl;
    return 0;
  }
  long long mod = 1e+9 + 7;
  long long res = sum[sum.size() - 1];
  for (long long i = 0; i < a.size() - 1; ++i) {
    if (a.size() == 0) break;
    res += a[i] * (sum[sum.size() - 1] - sum[i]);
    res %= mod;
  }
  res %= mod;
  cout << res << endl;
end:
  return 0;
}
