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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            char[] cs = in.next().toCharArray();
            int n = cs.length;
            int[] p2 = new int[n + 1];
            p2[0] = 1;
            int M = (int) (1e9 + 7);
            for (int i = 1; i <= n; i++) {
                p2[i] = p2[i - 1] + p2[i - 1];
                p2[i] %= M;
            }
            int[] b = new int[n];
            for (int i = n - 1; i >= 0; i--) {
                if (cs[i] == 'b') b[i] = 1;
                if (i < n - 1) b[i] += b[i + 1];
            }
//        for (int i = 0; i < n; ) {
//            if (cs[i] == 'a') {
//                int j = i;
//                while (j < n && cs[j] == 'a') j++;
//                int k = j;
//                while (k < n && cs[k] == 'b') k++;
//                
//            } else i++;
//        }
            int na = 0;
            long res = 0;
            for (int i = 0; i < n; i++) {
                if (cs[i] == 'a') {
                    res += (long) b[i] * p2[na] % M;
                    na++;
                }
            }
            out.println(res % M);
        }

    }

    static class Scanner {
        BufferedReader br;
        StringTokenizer st;

        public Scanner(InputStream in) {
            br = new BufferedReader(new InputStreamReader(in), 32768);
        }

        public String nextLine() {
            try {
                return br.readLine();
            } catch (IOException e) {
                return null;
            }
        }

        public boolean hasNext() {
            while (st == null || !st.hasMoreTokens()) {
                String s = nextLine();
                if (s == null)
                    return false;
                st = new StringTokenizer(s);
            }
            return true;
        }

        public String next() {
            hasNext();
            return st.nextToken();
        }

    }
}

