#include <bits/stdc++.h>
using namespace std;
const long long ool = (long long)1e18;
const int oo = (int)1e9 + 7;
const int N = (int)1e5 + 1;
const int N6 = (int)1e6 + 1;
const int N3 = (int)1e3 + 1;
const int N4 = (int)1e4 + 1;
const long double EPS = 1e-6;
int cntbit(int s) { return __builtin_popcount(s); }
int getbit(int s, int i) { return (s >> i) & 1; }
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int lcm(int a, int b) { return a / (gcd(a, b) * b); }
bool used[N + 5];
string s;
long long ans, cnt;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> s;
  for (int i = s.size() - 1; i >= (int)0; --i) {
    if (s[i] == 'b')
      cnt++;
    else {
      ans = (ans + cnt) % oo;
      cnt = cnt * 2 % oo;
    }
  }
  cout << ans << "\n";
  return 0;
}

### Prompt

Your task is to create 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;
const long long ool = (long long)1e18;
const int oo = (int)1e9 + 7;
const int N = (int)1e5 + 1;
const int N6 = (int)1e6 + 1;
const int N3 = (int)1e3 + 1;
const int N4 = (int)1e4 + 1;
const long double EPS = 1e-6;
int cntbit(int s) { return __builtin_popcount(s); }
int getbit(int s, int i) { return (s >> i) & 1; }
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int lcm(int a, int b) { return a / (gcd(a, b) * b); }
bool used[N + 5];
string s;
long long ans, cnt;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> s;
  for (int i = s.size() - 1; i >= (int)0; --i) {
    if (s[i] == 'b')
      cnt++;
    else {
      ans = (ans + cnt) % oo;
      cnt = cnt * 2 % oo;
    }
  }
  cout << ans << "\n";
  return 0;
}

```