#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, 1, -1, -1, -1, 1, 1};
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
template <class T>
inline T biton(T n, T pos) {
  return n | ((T)1 << pos);
}
template <class T>
inline T bitoff(T n, T pos) {
  return n & ~((T)1 << pos);
}
template <class T>
inline T ison(T n, T pos) {
  return (bool)(n & ((T)1 << pos));
}
template <class T>
inline T gcd(T a, T b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
template <typename T>
string NumberToString(T Number) {
  ostringstream second;
  second << Number;
  return second.str();
}
inline int nxt() {
  int aaa;
  scanf("%d", &aaa);
  return aaa;
}
inline long long int lxt() {
  long long int aaa;
  scanf("%I64d", &aaa);
  return aaa;
}
inline double dxt() {
  double aaa;
  scanf("%lf", &aaa);
  return aaa;
}
template <class T>
inline T bigmod(T p, T e, T m) {
  T ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % m;
    p = (p * p) % m;
  }
  return (T)ret;
}
int ar[100010];
int dp[100][100100];
long long int vis[100][100100];
bool ok = false;
long long int go(int pos, long long int c, int x, long long int a) {
  if (pos < 0) {
    if (c >= a) {
      return 1;
    }
    return (long long int)-1;
  }
  if (c <= 100000 && vis[pos][c] == x) return dp[pos][c];
  long long int mx = 0;
  if (c < a) mx = max(mx, go(pos - 1, c * ar[pos], x, a));
  mx = max(mx, go(pos - 1, c, x, a) * ar[pos]);
  if (c <= 100000) {
    vis[pos][c] = x;
    dp[pos][c] = mx;
  }
  return mx;
}
int main() {
  string s;
  cin >> s;
  long long int ans = 0;
  long long int cnt = 0;
  for (int i = s.length() - 1; i >= 0; i--) {
    if (s[i] == 'b')
      cnt++;
    else {
      ans += cnt;
      cnt = (cnt * 2) % 1000000007;
      if (ans >= 1000000007) ans -= 1000000007;
    }
  }
  cout << ans % 1000000007 << endl;
  return 0;
}
