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 double pi = 3.14159265359;
long long max(long long a, long long b) {
  if (a >= b)
    return a;
  else
    return b;
}
long long min(long long a, long long b) {
  if (a <= b)
    return a;
  else
    return b;
}
bool valid(int i, int j, long long n, long long m) {
  if (i >= 0 && i < n && j >= 0 && j < m)
    return 1;
  else
    return 0;
}
void yes() { cout << "YES" << '\n'; }
void no() { cout << "NO" << '\n'; }
bool prime[1200000];
map<long long, long long> primes;
void SieveOfEratosthenes(long long n = 1200000) {
  memset(prime, true, sizeof(prime));
  prime[1] = false;
  for (int p = 2; p * p < n; p++) {
    if (prime[p] == true) {
      for (int i = p * 2; i < n; i += p) prime[i] = false;
    }
  }
  for (int i = 1; i < n + 1; i++)
    if (prime[i]) {
      primes[i]++;
    }
}
string toBinary(long long n) {
  string r;
  while (n != 0) {
    r = (n % 2 == 0 ? "0" : "1") + r;
    n /= 2;
  }
  return r;
}
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
map<long long, long long> PF;
void primeFactors(unsigned long long n) {
  while (n % 2 == 0) {
    PF[2]++;
    n = n / 2;
  }
  for (int i = 3; i <= sqrt(n); i = i + 2) {
    while (n % i == 0) {
      PF[i]++;
      n = n / i;
    }
  }
  if (n > 2) PF[n]++;
}
long double intlog(long long base, long long x) {
  long double ans1 = log10(x), ans2 = log10(base);
  return (long double)(ans1 / ans2);
}
bool IsPowerOfTwo(long long x) { return (x & (x - 1)) == 0; }
map<long long, long long> LN;
void GetLuckyNumbers(string s) {
  if (s.size() > 10) return;
  GetLuckyNumbers(s + '4');
  if (s != "") LN[stoll(s)]++;
  GetLuckyNumbers(s + '7');
  if (s != "") LN[stoll(s)]++;
}
unsigned long long toDecimal(unsigned long long n) {
  unsigned long long num = n;
  unsigned long long dec_value = 0;
  unsigned long long base = 1;
  int temp = num;
  while (temp) {
    unsigned long long last_digit = temp % 10;
    temp = temp / 10;
    dec_value += last_digit * base;
    base = base * 2;
  }
  return dec_value;
}
long largest_power_of_two(long N) {
  N = N | (N >> 1);
  N = N | (N >> 2);
  N = N | (N >> 4);
  N = N | (N >> 8);
  return (N + 1) >> 1;
}
long long cnt(string s) {
  long long c = 0;
  for (int i = 0; i < s.size(); i++) c += s[i] - '0';
  return c;
}
bool ispal(string s) {
  for (int i = 0; i < s.size() / 2; i++) {
    if (s[i] != s[s.size() - i - 1]) return false;
  }
  return true;
}
map<string, long long> substrings;
void subString(string s, long long n) {
  for (int i = 0; i < n; i++)
    for (int len = 1; len <= n - i; len++) {
      substrings[s.substr(i, len)]++;
    }
}
bool check_divisabilty_prefix(string str, long long a) {
  long long len = str.size();
  vector<int> lr(len + 1, 0);
  lr[0] = (str[0] - '0') % a;
  for (int i = 1; i < len; i++)
    lr[i] = ((lr[i - 1] * 10) % a + (str[i] - '0')) % a;
  if (lr[len - 1] == 0) return 1;
  return 0;
}
bool check_divisabilty_suffix(string str, long long b) {
  long long len = str.size();
  vector<long long> rl(len + 1, 0);
  rl[len - 1] = (str[len - 1] - '0') % b;
  int power10 = 10;
  for (int i = len - 2; i >= 0; i--) {
    rl[i] = (rl[i + 1] + (str[i] - '0') * power10) % b;
    power10 = (power10 * 10) % b;
  }
  if (rl[0] == 0) return 1;
  return 0;
}
bool isSubSeq(int idx1, int idx2, string s1, string s2) {
  if (idx2 == s2.size()) return true;
  if (idx1 == s1.size()) return false;
  if (s1[idx1] == s2[idx2])
    return isSubSeq(idx1 + 1, idx2 + 1, s1, s2);
  else
    return isSubSeq(idx1 + 1, idx2, s1, s2);
}
vector<long long> v;
long long bs(long long st, long long en, long long rq, long long val) {
  long long ans;
  while (st <= en) {
    long long mid = (st + en) / 2;
    long long aa = v[mid] - v[rq];
    if (aa <= val) {
      st = mid + 1;
      ans = mid;
    } else
      en = mid - 1;
  }
  return abs(ans - rq);
}
bool isPerfectSquare(long double x) {
  if (x >= 0) {
    long long sr = sqrt(x);
    return (sr * sr == x);
  }
  return false;
}
long long gcd(long long a, long long b) {
  if (!b) return a;
  return gcd(b, a % b);
}
vector<long long> divisor;
void printDivisors(long long n) {
  divisor.clear();
  for (int i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i) {
        divisor.push_back(i);
      } else {
        divisor.push_back(i);
        divisor.push_back(n / i);
      }
    }
  }
}
long long nCr(long long n, long long r) {
  if (n < r) return 0;
  if (r > n - r) r = n - r;
  long long ans = 1;
  int i;
  for (i = 1; i <= r; i++) {
    ans *= n - r + i;
    ans /= i;
  }
  return ans;
}
void movestep(long long& a, long long& b, long long q) {
  long long nxt = a - (q * b);
  a = b;
  b = nxt;
}
long long gcdExtended(long long a, long long b, long long& x0, long long& y0) {
  long long r0 = a, r1 = b;
  long long x1, y1;
  x1 = y0 = 0;
  x0 = y1 = 1;
  while (r1 != 0) {
    long long q = r0 / r1;
    movestep(x0, x1, q);
    movestep(y0, y1, q);
    movestep(r0, r1, q);
  }
  return r0;
}
long long md = 998244353;
long long power(long long b, long long p) {
  if (p == 0)
    return 1;
  else if (p == 1)
    return b;
  long long a = power(b, p / 2);
  if (p % 2 == 0) return ((a % md) * (a % md)) % md;
  return ((b % md) * (a % md) * (a % md)) % md;
}
long long GcdForAllVector(vector<long long> vec) {
  sort(vec.begin(), vec.end());
  long long val = 0;
  for (int i = 1; i < vec.size(); i++) {
    val = gcd(vec[i] - vec[0], val);
  }
  return val;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  string s;
  cin >> s;
  long long cnt = 0;
  long long ans = 0;
  s += 'b';
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'a')
      cnt++;
    else if (s[i] == 'b') {
      ans = (ans + (ans + 1) * cnt) % 1000000007;
      cnt = 0;
    }
  }
  cout << ans << endl;
  ;
  return 0;
}
