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;
string t;
vector<int> b;
long long pas[100001];
int main() {
  cin >> t;
  long long s = 0;
  for (long long k = 0; k < t.size(); k++) {
    if (t[k] == 'a') {
      b.push_back(k);
      s++;
    }
  }
  if (s == 0) {
    cout << 0;
    return 0;
  }
  long long cur = 0;
  pas[b[b.size() - 1]] = 0;
  for (int k = b.size() - 2; k >= 0; k--) {
    bool iyo = false;
    for (long long j = b[k]; j < b[k + 1]; j++) {
      if (t[j] == 'b') {
        iyo = true;
        break;
      }
    }
    if (iyo) {
      if (pas[k] == 0) {
        pas[k] = b.size() - k - 1;
      } else
        pas[k] = (pas[k + 1] * 2 + b.size() - k) % 1000000007;
    } else
      pas[k] = (pas[k + 1] * 2) % 1000000007;
  }
  cout << pas[0] + s;
  return 0;
}
