#include <bits/stdc++.h>
using namespace std;
inline void fre1() {
  freopen("C:\\Users\\Administrator\\Desktop\\in.txt", "r", stdin);
  freopen("C:\\Users\\Administrator\\Desktop\\out.txt", "w", stdout);
}
inline void fre2() { fclose(stdin); }
const long long mod = 1e9 + 7;
const int maxn = 1e6 + 20, maxm = 1e3 + 20, INF = 1e9 + 7;
const double PI = acos(-1), eps = 1e-7;
int n, m, t, l, r;
char s[maxn];
int main() {
  scanf("%s", s + 1);
  int len = strlen(s + 1);
  long long cnt = 0, ans = 0;
  for (int i = len; i; --i) {
    if (s[i] == 'b')
      cnt = (cnt + 1) % mod;
    else {
      ans = (ans + cnt) % mod;
      cnt = (cnt * 2) % mod;
      ;
    }
  }
  printf("%I64d\n", ans);
  return 0;
}
