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;
const int chartointdiff = 48;
vector<long long> to_binary(long long n) {
  int i = 7;
  vector<long long> ans(8);
  while (n >= 2) {
    ans[i] = n % 2;
    n /= 2;
    i--;
  }
  ans[i] = n;
  return ans;
}
long long digitSum(long long n) {
  long long ans = 0;
  while (n > 0) {
    ans += (n % 10);
    n /= 10;
  }
  return ans;
}
long long digitsCount(long long n) {
  long long ans = 0;
  while (n > 0) {
    ans++;
    n /= 10;
  }
  return ans;
}
bool cmp(pair<long long, long long> p1, pair<long long, long long> p2) {
  return (p1.first < p2.first);
}
map<long long, long long> primefactorisation(long long n) {
  map<long long, long long> mp;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      mp[i] = 0;
      while (n % i == 0) {
        mp[i]++;
        n /= i;
      }
    }
  }
  if (n > 1) {
    mp[n] = 1;
  }
  return mp;
}
long long switch_off_i(long long n, long long i) {
  long long temp = LLONG_MAX;
  long long tk = 1;
  tk = tk << i;
  temp = temp ^ tk;
  long long ans = n & temp;
  return ans;
}
long long switch_on_i(long long n, long long i) {
  long long temp = 1;
  temp = temp << i;
  long long ans = n | temp;
  return ans;
}
vector<bool> seive(long long n) {
  vector<bool> arr(n + 1, true);
  for (int i = 2; i * i <= n; i++) {
    if (arr[i]) {
      for (int j = i * i; j <= n; j += i) {
        arr[j] = false;
      }
    }
  }
  return arr;
}
bool isprime(long long x) {
  for (long long i = 2; i * i <= x; i++) {
    if (x % i == 0) {
      return 0;
    }
  }
  return 1;
}
vector<string> bor = {"YES", "NO"};
void solve() {
  string s;
  cin >> s;
  long long n = s.size();
  vector<long long> powk(n + 1);
  powk[0] = (long long)1;
  for (long long i = 1; i <= n; i++) {
    long long temp =
        ((powk[i - 1] % (long long)(1e9 + 7)) *
         ((long long)2 % (long long)(1e9 + 7)) % (long long)(1e9 + 7));
    powk[i] = temp % (long long)(1e9 + 7);
  }
  long long ac = 0, bc = 0;
  long long low = 0;
  while (s[low] == 'b') low++;
  long long ans = 0;
  for (int i = low; i < n; i++) {
    if (s[i] == 'a')
      ac++;
    else {
      long long k = i;
      bc = 0;
      while (s[k] == 'b') {
        k++;
        bc++;
      }
      i = k - 1;
      ans += (((bc) * (((powk[ac]) - (long long)1))) % (long long)(1e9 + 7));
    }
  }
  cout << ans % (long long)(1e9 + 7) << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
