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".
import java.io.*;
import java.util.*;

public class D {

    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;

    public static void main(String[] args) throws IOException {
        try {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter(new File("output.txt"));
        } catch (Exception e) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(new OutputStreamWriter(System.out));
        }
        tok = new StringTokenizer("");
        new D().solve();
        out.flush();
        out.close();
    }

    String nextTok() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    String nextLine() throws IOException {
        return in.readLine();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextTok());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextTok());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextTok());
    }

    class Pair implements Comparable<Pair>{
        double x;
        double y;
        Pair(double x, double y) {
            this.x = x;
            this.y = y;
        }

        @Override
        public int compareTo(Pair o) {
            if (x != o.x) return Double.compare(x,o.x);
            return Double.compare(y,o.y);
        }
    }

    class Tri implements Comparable<Tri>{
        long cost;
        long l;
        long r;

        Tri(long cost, long l, long r) {
            this.cost = cost;
            this.l = l;
            this.r = r;
        }

        @Override
        public int compareTo(Tri o) {
            if (cost != o.cost) return Long.compare(cost,o.cost);
            if (l != o.l) return Long.compare(l,o.l);
            return Long.compare(r,o.r);
        }
    }

    long MOD = 1000000007;

    void solve() throws IOException {
        StringBuilder sb = new StringBuilder(nextLine());
        int max = 1000010;
        long sum[] = new long[max];
        long pref[] = new long[max];
        sum[0] = sum[1] = 2;
        pref[0] = 0;
        pref[1] = 2;
        for (int i = 2; i < max; i++) {
            sum[i] = sum[i-1]*2L;
            sum[i] %= MOD;
            pref[i] = pref[i-1]+sum[i];
            pref[i] %= MOD;
        }
        long aCnt = 0;
        long ans = 0;

        for (int i = 1; i < sb.length(); i++) {
            if (sb.charAt(i-1) == 'a' && sb.charAt(i) == 'b') {
                ans += pref[(int)aCnt];
                ans += 1L;
                ans %= MOD;
                sb.setCharAt(i,'a');
            } else {
                if (sb.charAt(i-1) == 'a') {
                    aCnt++;
                }
            }
        }
//        System.out.println(aCnt);
        System.out.println(ans);
    }

}