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.io.IOException;
import java.util.InputMismatchException;
import java.io.InputStream;

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

    static class TaskD {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            char[] s = in.nextLine((int) (1e6)).toCharArray();
            int aCnt = 0;
            long ans = 0;
            long mod = (long) (1e9 + 7);

            long f[] = new long[s.length + 1];
            f[0] = 1;
            for (int i = 1; i < f.length; ++i) {
                f[i] = (1 + 2 * f[i - 1]) % mod;
            }
//        System.out.println(Arrays.toString(f));
            long[] sum = new long[f.length];
            sum[0] = f[0];
            for (int i = 1; i < sum.length; ++i) {
                sum[i] = (f[i] + sum[i - 1]) % mod;
            }

            for (char c : s) {
                if (c == 'a') {
                    ++aCnt;
                }
                if (c == 'b') {
                    if (aCnt > 0) {
                        ans = (ans + f[aCnt - 1]) % mod;
                    }
                }
            }
            out.println(ans);
        }

    }

    static class InputReader implements AutoCloseable {
        private final InputStream in;
        private int capacity;
        private byte[] buffer;
        private int len = 0;
        private int cur = 0;

        public InputReader(InputStream stream) {
            this(stream, 100_000);
        }

        public InputReader(InputStream stream, int capacity) {
            this.in = stream;
            this.capacity = capacity;
            buffer = new byte[capacity];
        }

        private boolean update() {
            if (cur >= len) {
                try {
                    cur = 0;
                    len = in.read(buffer, 0, capacity);
                    if (len <= 0)
                        return false;
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return true;
        }

        private int read() {
            if (update())
                return buffer[cur++];
            else return -1;
        }

        private boolean isSpace(int c) {
            return c == '\n' || c == '\t' || c == '\r' || c == ' ';
        }

        private boolean isEscape(int c) {
            return c == '\n' || c == '\t' || c == '\r' || c == -1;
        }

        private int readSkipSpace() {
            int c;
            do {
                c = read();
            } while (isSpace(c));
            return c;
        }

        public String nextLine(int initialCapacity) {
            StringBuilder res = new StringBuilder(initialCapacity);
            int c = readSkipSpace();
            do {
                res.append((char) (c));
                c = read();
            } while (!isEscape(c));
            return res.toString();
        }


        public void close() throws IOException {
            in.close();
        }

    }
}

