#include <bits/stdc++.h>
using namespace std;
long long dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
long long ddx[8] = {1, 1, 0, -1, -1, -1, 0, 1},
          ddy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
long long gcd(long long a, long long b) {
  if (!a) return b;
  return gcd(b % a, a);
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
const long long MAX = 1e6 + 2047;
const long long mod = 1e9 + 7;
const long long MAX_2 = 1009;
void sout() { cout << "\n"; }
template <typename T, typename... Types>
void sout(T var1, Types... var2) {
  cout << var1 << " ";
  sout(var2...);
}
template <typename T>
void sout(vector<T> arr) {
  for (auto it : arr) {
    cout << it << " ";
  }
  sout();
}
template <typename T>
void sout(set<T> st) {
  for (auto it : st) {
    cout << it << " ";
  }
  sout();
}
long long binpow(long long a, long long b) {
  a %= mod;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return res;
}
long long mul(long long a, long long b) { return (a % mod) * (b % mod) % mod; }
long long add(long long a, long long b) { return (a % mod + b % mod) % mod; }
long long sub(long long a, long long b) {
  return (a % mod - b % mod + mod) % mod;
}
long long divide(long long a, long long b) {
  return a * (long long)binpow(b, mod - 2) % mod;
}
void test_case() {
  string s;
  cin >> s;
  long long ans = 0;
  long long a = 0;
  for (long long i = 0; i < (long long)s.size(); i++) {
    if (s[i] == 'a') {
      a++;
    } else {
      if (a > 0) {
        ans = add(ans, sub(binpow(2 * 1ll, a), 1));
      }
    }
  }
  cout << ans << "\n";
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(10);
  long long t = 1;
  while (t--) {
    test_case();
  }
}

### Prompt

Your challenge is to write a cpp solution to the following problem:

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".

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
long long dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
long long ddx[8] = {1, 1, 0, -1, -1, -1, 0, 1},
          ddy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
long long gcd(long long a, long long b) {
  if (!a) return b;
  return gcd(b % a, a);
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
const long long MAX = 1e6 + 2047;
const long long mod = 1e9 + 7;
const long long MAX_2 = 1009;
void sout() { cout << "\n"; }
template <typename T, typename... Types>
void sout(T var1, Types... var2) {
  cout << var1 << " ";
  sout(var2...);
}
template <typename T>
void sout(vector<T> arr) {
  for (auto it : arr) {
    cout << it << " ";
  }
  sout();
}
template <typename T>
void sout(set<T> st) {
  for (auto it : st) {
    cout << it << " ";
  }
  sout();
}
long long binpow(long long a, long long b) {
  a %= mod;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return res;
}
long long mul(long long a, long long b) { return (a % mod) * (b % mod) % mod; }
long long add(long long a, long long b) { return (a % mod + b % mod) % mod; }
long long sub(long long a, long long b) {
  return (a % mod - b % mod + mod) % mod;
}
long long divide(long long a, long long b) {
  return a * (long long)binpow(b, mod - 2) % mod;
}
void test_case() {
  string s;
  cin >> s;
  long long ans = 0;
  long long a = 0;
  for (long long i = 0; i < (long long)s.size(); i++) {
    if (s[i] == 'a') {
      a++;
    } else {
      if (a > 0) {
        ans = add(ans, sub(binpow(2 * 1ll, a), 1));
      }
    }
  }
  cout << ans << "\n";
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(10);
  long long t = 1;
  while (t--) {
    test_case();
  }
}

```