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 cnt[100010] = {0}, dema[100010] = {0};
string s;
void timb(int x, int y) {
  for (int i = x; i < s.size(); i++)
    if (s[i] == 'b') {
      cnt[y] += dema[i];
      timb(i + 1, y);
      break;
    }
}
int main() {
  cin >> s;
  for (int i = 0; i < s.size(); i++)
    if ((s[i] != 'a' && s[i] != 'b') || (s[i] == 'b' && s[i + 1] == 'b')) {
      s.erase(i, 1);
      i--;
    }
  for (int i = s.size() - 1; i >= 0; i--) {
    if (s[i] == 'a') dema[i]++;
    dema[i] += dema[i + 1];
  }
  long long dem = 0, doitt = 0;
  for (int i = 0; i < s.size(); i++)
    if (s[i] == 'a') {
      cnt[i]++;
      timb(i + 1, i);
      dem += cnt[i] %= 1000000007;
    }
  cout << dem % 1000000007;
}
