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;
int dr[8] = {-1, 0, +1, 0, -1, -1, +1, +1};
int dc[8] = {0, +1, 0, -1, -1, +1, -1, +1};
int kx[8] = {-1, +1, +1, -1, +2, +2, -2, -2};
int ky[8] = {+2, +2, -2, -2, -1, +1, +1, -1};
const int N = 200005;
long long binpow(long long a, long long b) {
  long long res = 1;
  a %= 1000000007;
  while (b > 0) {
    if (b & 1) res = (res * a) % 1000000007;
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return res;
}
int main() {
  string s;
  cin >> s;
  long long ans = 0;
  int n = s.size();
  s += 'b';
  int cnt = 0;
  vector<long long> vec;
  for (int i = 0; i <= n; ++i) {
    if (s[i] == 'a')
      cnt++;
    else if (s[i] == 'b' && cnt) {
      vec.push_back(cnt);
      cnt = 0;
    }
  }
  long long x = vec.size();
  for (auto i : vec) {
    ans = (ans + binpow(i, x)) % 1000000007;
  }
  cout << ans << endl;
}
