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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.StringTokenizer;

public class Main2 {

    static long mod = 1000000007L;

    public static void main(String[] args) throws Exception {
        FastScanner scanner = new FastScanner();
        String s = scanner.nextToken();
        /*char[] cc = new char[1000000];
        for (int i = 0; i < cc.length; i++) cc[i] = 'a';
        for (int i = 1; i < cc.length; i+=2) cc[i] = 'b';
        //cc[999999] = 'b';
        String s = String.valueOf(cc);*/
        int idx = 0;
        long result = 0;
        BigInteger two = BigInteger.valueOf(2);
        int additionalA = 0;
        BigInteger modBI = BigInteger.valueOf(mod);
        while (idx < s.length()) {
            idx = moveToA(s, idx);
            if (idx == s.length()) break;
            int idx2 = moveToB(s, idx);
            if (idx2 == s.length()) break;
            int idx3 = moveToA(s, idx2);

            long bCount = idx3 - idx2;
            int aCount = additionalA + idx2 - idx;
            long pow = modpow(2, aCount, mod);
            if (pow == 0) {
                pow = mod - 1;
            } else {
                pow = pow - 1;
            }
            long res = (bCount * pow) % mod;
            result = (result + res) % mod;

            additionalA = aCount;
            idx = idx3;
        }
        System.out.println(result);
    }

    static long modpow(long base, long exp, long modulus) {
        base %= modulus;
        long result = 1;
        while (exp > 0) {
            if ((exp & 1) == 1) result = (result * base) % modulus;
            base = (base * base) % modulus;
            exp >>= 1;
        }
        return result;
    }

    static int moveToA(String s, int idx) {
        while (idx < s.length() && s.charAt(idx) == 'b') {
            idx++;
        }
        return idx;
    }

    static int moveToB(String s, int idx) {
        while (idx < s.length() && s.charAt(idx) == 'a') {
            idx++;
        }
        return idx;
    }

    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String nextToken() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        String nextLine() {
            try {
                return br.readLine();
            } catch (Exception e) {
                e.printStackTrace();
                throw new RuntimeException();
            }
        }

        int nextInt() {
            return Integer.parseInt(nextToken());
        }

        long nextLong() {
            return Long.parseLong(nextToken());
        }

        double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }
}

//934762435