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".
/**
 * Created by Aminul on 5/4/2017.
 */

import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class CF805D {
    public static int a[], b[];
    public static void main(String[] args)throws Exception {
        InputReader in = new InputReader(System.in);
        PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));
        char [] s = in.next().toCharArray();
        int n = s.length;
        a = new int[n]; b = new int[n];

        long ans = 0, mod = 7+(long)1e9;


        for(int i = 0; i < n-1; i++){

            int idx = check(s, i);
            if(idx == -1) break;
            i = idx;
            int aa = getA(s, i);
            int bb = getB(s, i);
            a[i+bb] = aa;


            long temp = bigmod(2, aa, mod)-1l;
            temp *= bb;
            temp %= mod;
            ans += temp;

            ans %= mod;

        }

        pw.println(ans);

        pw.close();
    }

    static int getA(char[] s,int x){
        int cnt = 0;
        for(int i = x; i >= 0; i--){
            if(a[i] != 0){
                cnt += a[i];
               // debug(i, cnt);
                return cnt;
            }
            else if(s[i] == 'a'){
                cnt++;
            }
            else break;
        }
        return cnt;
    }

    static int getB(char[] s,int x){
        int cnt = 0;
        for(int i = x+1; i < s.length; i++){
            if(s[i] == 'b'){
                cnt++;
            }
            else break;
        }
        return cnt;
    }


    static long bigmod ( long a, long p, long m ) { // returns (a^p) % m
        long res = 1 % m, x = a % m;
        while ( p > 0 ) {
            if ( (p & 1) > 0 ) res = ( res * x ) % m;
            x = ( x * x ) % m; p >>= 1;
        }
        return res;
    }

    static int check(char[] s, int x){
        for(int i = x; i < s.length-1; i++){
            if(s[i] =='a' && s[i+1] == 'b') return i;
        }
        return -1;
    }



    static void debug(Object...obj) {
        System.err.println(Arrays.deepToString(obj));
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String next()throws Exception {
            while (tokenizer == null || !tokenizer.hasMoreTokens())
                tokenizer = new StringTokenizer(reader.readLine());
            return tokenizer.nextToken();
        }

        public String nextLine()throws Exception {
            String line = null;
            tokenizer = null;
            line =  reader.readLine();
            return line;
        }

        public int nextInt()throws Exception {
            return Integer.parseInt(next());
        }

        public double nextDouble() throws Exception{
            return Double.parseDouble(next());
        }

        public long nextLong()throws Exception {
            return Long.parseLong(next());
        }

    }
}