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;
vector<bool> isprime(1e7 + 1, true);
struct node {
  long long lenght;
};
void Sieve(long long maxn) {
  long long j;
  isprime[0] = isprime[1] = false;
  for (int i = 2; i < sqrt(maxn) + 1; i++) {
    if (isprime[i]) {
      for (j = i * i; j <= maxn; j += i) {
        isprime[j] = false;
      }
    }
  }
}
struct comparefunction {
  bool operator()(const pair<long long int, long long int> c,
                  const pair<long long int, long long int> d) const {
    long long lenc = c.second - c.first + 1;
    long long lend = d.second - d.first + 1;
    if (lenc != lend)
      return lenc > lend;
    else
      return c.first < d.first;
  }
};
void dfs(long long v, vector<bool> visited, vector<int> adj[]) {
  visited[v] = true;
  for (int u : adj[v]) {
    if (!visited[u]) dfs(u, visited, adj);
  }
}
long long modpow(long long x, long long n, long long p) {
  if (n == 0) return 1;
  if (n == 1) return x % p;
  if (n % 2 == 0)
    return (modpow(x, n / 2, p) % p) * (modpow(x, n / 2, p) % p);
  else
    return (x % p) * (modpow(x, n / 2, p) % p) * (modpow(x, n / 2, p) % p);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long check1 = 0, check2 = 0, check3 = 0;
  long long counti = 0, i = 0, j;
  long long sum = 0, count = 0, t, k, a, b, q, c, d, l, r;
  long long s;
  long long m, n;
  long long p = 1e9 + 7;
  string str;
  cin >> str;
  n = str.size();
  long long ans = 0;
  long long acount = 0;
  for (int i = 0; i < n; i++) {
    if (str[i] == 'a') acount++;
    if (i == 0) continue;
    if (str[i] == 'b' && str[i - 1] == 'a' && !check1) {
      ans += (modpow(2, acount, p) - 1) % p;
      check1 = 1;
      continue;
    }
    if (check1) {
      if (str[i] == 'b') {
        ans += (modpow(2, acount, p) - 1) % p;
      }
    }
  }
  cout << ans % p;
}
