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;
const int MOD = (int)1e9 + 7, MAX_N = (int)1e5 + 15;
string s;
long long ans;
void in() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  char c, last = '#';
  while (cin >> c) {
    if (c != 'a' && c != 'b' || c == 'b' && (last == 'b' || last == '#')) {
      last = c;
      continue;
    }
    s += c;
    last = c;
  }
}
void solution() {
  if (s.back() == 'b') {
    s.erase(--s.end());
  }
  vector<int> v;
  int st = 0, fn = 0;
  for (int i = 1; i < s.size(); ++i) {
    if (s[i] != s[i - 1]) {
      v.push_back(fn - st + 1);
      st = fn = i + 1;
      ++i;
    }
    ++fn;
  }
  fn = min(fn, (int)s.size() - 1);
  v.push_back(fn - st + 1);
  ans = v[0];
  for (int i = 1; i < v.size(); ++i) {
    ans = (ans + (((1 + ans) % MOD) * v[i]) % MOD) % MOD;
  }
}
void out() { cout << ans << "\n"; }
int main() {
  in();
  solution();
  out();
  return 0;
}
