#include <bits/stdc++.h>
using namespace std;
bool isPrime(int 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;
}
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  std::cout.precision(15);
  long long mod = 1000000007;
  string s;
  cin >> s;
  int len = s.size();
  long long a = 0, b = 0;
  long long cnt = 0;
  for (int i = len - 1; i >= 0; i--) {
    if (s[i] == 'b')
      a++;
    else {
      cnt = cnt + a;
      a = a * 2;
      cnt = cnt % mod;
      a = a % mod;
    }
  }
  cout << cnt;
}
