#include <bits/stdc++.h>
using namespace std;
int now, p = 1, ans;
char s[1000010];
inline int read() {
  register int x = 0, v = 1, ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') v = -1;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return x * v;
}
int main() {
  scanf("%s", s);
  for (register int i = 0; s[i]; i++)
    if (s[i] == 'a')
      now++, p = p * 2 % 1000000007;
    else
      ans += (p - 1 + 1000000007) % 1000000007, ans %= 1000000007;
  cout << ans << endl;
  return 0;
}
