#include <bits/stdc++.h>
using namespace std;
inline void out(int a) { printf("%d\n", a); }
inline void out(int a, int b) { printf("%d %d\n", a, b); }
inline void outf(double a) { printf("%3.lf\n", a); }
inline void outf(double a, double b) { printf("%3.lf %3.lf\n", a, b); }
inline void base() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
}
int main() {
  base();
  string s;
  cin >> s;
  long long ans = 0;
  long long b = 0;
  for (int(i) = (s.length() - 1); (i) >= (0); (i)--) {
    if (s[i] == 'b')
      b++;
    else {
      ans += b;
      ans %= 1000000007;
      b *= 2;
    }
    b %= 1000000007;
  }
  cout << ans << endl;
  return 0;
}
