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 long long mod = 1000000007;
long long n, ans = 0, kol, obsch;
string s;
char c = 'a';
char notc(char a) {
  if (a == 'a') return 'b';
  return 'a';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  n = (long long)s.size();
  for (int i = 0; i < n; i++)
    if (s[i] == c) {
      kol++;
      obsch++;
    } else if (s[i] == notc(c)) {
      if (ans == 0)
        ans = kol;
      else if (kol > 0) {
        ans *= kol;
        ans %= mod;
      }
      kol = 0;
    }
  if (kol > 0) ans *= kol;
  ans += obsch;
  cout << ans;
  return 0;
}
