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;
long long int m(long long int a, long long int b) {
  return ((a % 1000000007) * (b % 1000000007)) % 1000000007;
}
long long int sub(long long int a, long long int b) {
  long long int ans = ((a % 1000000007) - (b % 1000000007)) % 1000000007;
  if (ans < 0) ans += 1000000007;
  return ans;
}
long long int a(long long int a, long long int b) {
  return ((a % 1000000007) + (b % 1000000007)) % 1000000007;
}
long long int productOfSubsetSums(vector<long long int>& v) {
  long long int ans = 1;
  for (long long int i = 0; i < v.size(); ++i) ans = m(ans, a(v[i], 1));
  return sub(ans, 1);
}
int32_t main() {
  string s;
  cin >> s;
  vector<long long int> v;
  long long int cur = 0;
  for (auto x : s) {
    if (x == 'a')
      ++cur;
    else if (x == 'b') {
      if (cur != 0) v.push_back(cur);
      cur = 0;
    }
  }
  if (cur != 0) v.push_back(cur);
  cout << productOfSubsetSums(v);
  return 0;
}
