#include <bits/stdc++.h>
using namespace std;
const int64_t N = 1e6 + 6, M = 1e9 + 7;
int main() {
  ios::sync_with_stdio(false), cin.tie(nullptr);
  string s;
  cin >> s;
  int64_t x = 0, ans = 0;
  reverse(s.begin(), s.end());
  for (char c : s) {
    if (c == 'b')
      x++;
    else
      ans = (ans + x) % M, x = (x * 2) % M;
  }
  cout << ans;
  return 0;
}
