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 Solution {
    static MyScanner sc;
    private static PrintWriter out;
    static long M2 = 1_000_000_000L + 7;

    public static void main(String[] s) throws Exception {
        StringBuilder stringBuilder = new StringBuilder();
//        stringBuilder.append("100000 1000000000 10001 100000 ");
//        for (int i = 1; i < 100000; i++) {
//            stringBuilder.append(" 10000 100000 ");
//        }
        if (stringBuilder.length() == 0) {
            sc = new MyScanner(System.in);
        } else {
            sc = new MyScanner(new BufferedReader(new StringReader(stringBuilder.toString())));
        }


        out = new PrintWriter(new OutputStreamWriter(System.out));
        initData();
        solve();
        out.flush();
    }


    private static void initData() {

    }

    private static void solve() throws IOException {
        String l = sc.next();
        long res = 0;
        long curb = 0;
        for (int k = l.length() - 1; k >= 0; k--) {
            if (l.charAt(k) == 'b') {
                curb++;
            } else {
                res += curb;
                res %= M2;
                curb <<= 1;
                curb %= M2;
            }
        }
        out.println(res);

    }

    private static long st(int n, double[] mulf, double[] mulp, int[] solved, int[] next, long max) {
        if (l(0, n, mulf, mulp, next, solved)) {
            return 0;
        }

        if (!l(max, n, mulf, mulp, next, solved)) {
            return -1;
        }
        long min = 0;
        while (min + 1 < max) {
            long mid = (min + max) / 2;
            if (l(mid, n, mulf, mulp, next, solved)) {
                max = mid;
            } else {
                min = mid;
            }
        }
        return max;
    }

    private static boolean l(long add, int count, double[] mulf, double[] mulp, int[] next, int[] solved) {
        int[] realSolved = Arrays.copyOf(solved, 5);

        for (int i = 0; i < 5; i++) {
            realSolved[i] += add * next[i];
        }
        return p(mulf, realSolved, add + count) > p(mulp, realSolved, add + count);
    }

    private static double p(double[] mulf, int[] realSolved, long partic) {
        double points = 0;
        for (int s = 0; s < mulf.length; s++) {
            if (realSolved[s] * 2 > partic) {
                points += 500 * mulf[s];
                continue;
            }
            if (realSolved[s] * 4 > partic) {
                points += 1000 * mulf[s];
                continue;
            }
            if (realSolved[s] * 8 > partic) {
                points += 1500 * mulf[s];
                continue;
            }
            if (realSolved[s] * 16 > partic) {
                points += 2000 * mulf[s];
                continue;
            }
            if (realSolved[s] * 32 > partic) {
                points += 2500 * mulf[s];
                continue;
            }
            points += 3000 * mulf[s];
        }

        return points;
    }

    private static double[] ct(int[] ff) {
        double[] r = new double[5];
        for (int i = 0; i < ff.length; i++) {
            if (ff[i] >= 0)
                r[i] = (1 - ff[i] * 1.0 / 250);
        }
        return r;
    }


    private static void solveT() throws IOException {
        int t = sc.nextInt();
        while (t-- > 0) {
            solve();
        }
    }

    private static long gcd(long l, long l1) {
        if (l > l1) return gcd(l1, l);
        if (l == 0) return l1;
        return gcd(l1 % l, l);
    }

    private static long pow(long a, long b, long m) {
        if (b == 0) return 1;
        if (b == 1) return a;
        long pp = pow(a, b / 2, m);
        pp *= pp;
        pp %= m;
        return (pp * (b % 2 == 0 ? 1 : a)) % m;
    }


    static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        MyScanner(BufferedReader br) {
            this.br = br;
        }

        public MyScanner(InputStream in) {
            this(new BufferedReader(new InputStreamReader(in)));
        }

        void findToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
        }

        String next() {
            findToken();
            return st.nextToken();
        }

        Integer[] nab(int n) {
            Integer[] k = new Integer[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.fi();
            }
            return k;
        }

        int[] na(int n) {
            int[] k = new int[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.fi();
            }
            return k;
        }

        long[] nl(int n) {
            long[] k = new long[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.nextLong();
            }
            return k;
        }

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

        int fi() {
            String t = next();
            int cur = 0;
            boolean n = t.charAt(0) == '-';
            for (int a = n ? 1 : 0; a < t.length(); a++) {
                cur = cur * 10 + t.charAt(a) - '0';
            }
            return n ? -cur : cur;
        }

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

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


}