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;
long long gcd(long long a, long long b) {
  if (b > a) {
    return gcd(b, a);
  }
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
long long expo(long long a, long long b, long long mod) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b = b >> 1;
  }
  return res;
}
void extendgcd(long long a, long long b, long long *v) {
  if (b == 0) {
    v[0] = 1;
    v[1] = 0;
    v[2] = a;
    return;
  }
  extendgcd(b, a % b, v);
  long long x = v[1];
  v[1] = v[0] - v[1] * (a / b);
  v[0] = x;
  return;
}
long long mminv(long long a, long long b) {
  long long arr[3];
  extendgcd(a, b, arr);
  return arr[0];
}
long long mminvprime(long long a, long long b) { return expo(a, b - 2, b); }
bool revsort(long long a, long long b) { return a > b; }
void swap(int &x, int &y) {
  int temp = x;
  x = y;
  y = temp;
}
long long combination(long long n, long long r, long long m, long long *fact,
                      long long *ifact) {
  long long val1 = fact[n];
  long long val2 = ifact[n - r];
  long long val3 = ifact[r];
  return (((val1 * val2) % m) * val3) % m;
}
void google(int t) { cout << "Case #" << t << ": "; }
vector<long long> sieve(int n) {
  int *arr = new int[n + 1]();
  vector<long long> vect;
  for (int i = 2; i <= n; i++)
    if (arr[i] == 0) {
      vect.push_back(i);
      for (int j = 2 * i; j <= n; j += i) arr[j] = 1;
    }
  return vect;
}
long long mod_add(long long a, long long b, long long m) {
  a = a % m;
  b = b % m;
  return (((a + b) % m) + m) % m;
}
long long mod_mul(long long a, long long b, long long m) {
  a = a % m;
  b = b % m;
  return (((a * b) % m) + m) % m;
}
long long mod_sub(long long a, long long b, long long m) {
  a = a % m;
  b = b % m;
  return (((a - b) % m) + m) % m;
}
long long mod_div(long long a, long long b, long long m) {
  a = a % m;
  b = b % m;
  return (mod_mul(a, mminvprime(b, m), m) + m) % m;
}
long long phin(long long n) {
  long long number = n;
  if (n % 2 == 0) {
    number /= 2;
    while (n % 2 == 0) n /= 2;
  }
  for (long long i = 3; i <= sqrt(n); i += 2) {
    if (n % i == 0) {
      while (n % i == 0) n /= i;
      number = (number / i * (i - 1));
    }
  }
  if (n > 1) number = (number / n * (n - 1));
  return number;
}
bool isPrime(int n) {
  if (n <= 1) return false;
  for (int i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
struct P {
  long long x, y;
  void read() { cin >> x >> y; }
  P operator-(const P &b) const { return P{x - b.x, y - b.y}; }
  void operator-=(const P &b) {
    x -= b.x;
    y -= b.y;
  }
  long long operator*(const P &b) const {
    return (long long)x * b.y - (long long)y * b.x;
  }
  long long triangle(const P &b, const P &c) const {
    return (b - *this) * (c - *this);
  }
  bool operator<(const P &b) const {
    return make_pair(x, y) < make_pair(b.x, b.y);
  }
};
bool intersect(P p1, P p2, P p3, P p4) {
  if ((p2 - p1) * (p4 - p3) == 0) {
    if (p1.triangle(p2, p3) != 0) {
      return false;
    }
    for (int rep = 0; rep < 2; rep++) {
      if ((max(p1.x, p2.x) < min(p3.x, p4.x)) ||
          max(p1.y, p2.y) < (min(p3.y, p4.y))) {
        return false;
      }
      swap(p1, p3);
      swap(p2, p4);
    }
  }
  return true;
}
long long area1(vector<P> polygon, int n) {
  long long area = 0;
  for (long long i = 0; i < n; i++) {
    area += polygon[i] * polygon[i + 1 == n ? 0 : i + 1];
  }
  return abs(area);
}
float power(float x, int y) {
  float temp;
  if (y == 0) return 1;
  temp = power(x, y / 2);
  if (y % 2 == 0)
    return temp * temp;
  else {
    if (y > 0)
      return x * temp * temp;
    else
      return (temp * temp) / x;
  }
}
long long mod = 1e9 + 7;
long long n, m;
vector<vector<long long>> g;
vector<long long> vis;
vector<long long> parent;
void tootahuadil() {
  string pyrr;
  cin >> pyrr;
  int k = 0;
  int c = 0;
  for (int i = pyrr.size() - 1; i >= 0; i--) {
    if (pyrr[i] == 'b') {
      c++;
    } else {
      k += c;
      c = c * 2;
      k = k % mod;
      c = c % mod;
    }
  }
  cout << k << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  tootahuadil();
}
