#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5, mod = 1e9 + 7;
int dp[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int sz = s.size();
  long long ans = 0;
  s += 'a';
  for (int i = sz - 1; i >= 0; i--) {
    if (s[i] == 'b')
      dp[i] = 1 + dp[i + 1];
    else if (s[i + 1] == 'b') {
      ans += dp[i + 1];
      ans %= mod;
      s[i] = 'b';
      dp[i] = 2 * dp[i + 1];
      dp[i] %= mod;
    }
  }
  cout << ans;
}
