We have a string of letters 'a' and 'b'. We want to perform some operations on it. On each step we choose one of substrings "ab" in the string and replace it with the string "bba". If we have no "ab" as a substring, our job is done. Print the minimum number of steps we should perform to make our job done modulo 109 + 7.

The string "ab" appears as a substring if there is a letter 'b' right after the letter 'a' somewhere in the string.

Input

The first line contains the initial string consisting of letters 'a' and 'b' only with length from 1 to 106.

Output

Print the minimum number of steps modulo 109 + 7.

Examples

Input

ab


Output

1


Input

aab


Output

3

Note

The first example: "ab"  →  "bba".

The second example: "aab"  →  "abba"  →  "bbaba"  →  "bbbbaa".
#include <bits/stdc++.h>
using namespace std;
uint64_t modpow(uint64_t base, uint64_t exp, uint64_t modulus) {
  base %= modulus;
  uint64_t result = 1;
  while (exp > 0) {
    if (exp & 1) result = (result * base) % modulus;
    base = (base * base) % modulus;
    exp >>= 1;
  }
  return result;
}
int64_t calc(int64_t cnt1, int64_t cnt2) {
  int64_t res = modpow(2, cnt1, 1000000007) + 1000000007 - 1;
  res %= 1000000007;
  res *= cnt2;
  res %= 1000000007;
  return res;
}
void solve() {
  string s;
  cin >> s;
  int64_t n = s.size();
  int64_t curr = 0;
  while (curr < s.size() && s[curr] == 'b') curr++;
  char c = s[curr];
  int64_t cnt = 0;
  int64_t cntA = 0;
  int64_t res = 0;
  for (int64_t i = curr; i < n; i++) {
    if (c == s[i]) {
      cnt++;
    } else {
      if (c == 'a') {
        cntA = cnt;
        cnt = 1;
      }
      if (c == 'b') {
        res += calc(cntA, cnt);
        res %= 1000000007;
        cnt = cntA + 1;
      }
      c = s[i];
    }
  }
  if (c == 'b') {
    res += calc(cntA, cnt);
    res %= 1000000007;
    cnt = cntA + 1;
  }
  cout << res << endl;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
