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

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

    static class TaskB {
        private static final long BASE = 1_000_000_007;

        private long pow_mod(long base, long pow) {
            long temp = base;
            long ans = 1;

            while (pow > 0) {
                if (pow % 2 == 1) {
                    ans = (ans * temp) % BASE;
                }

                temp = (temp * temp) % BASE;
                pow /= 2;
            }

            return ans;
        }

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            String s = in.nextString();
            ArrayList<Long> list = new ArrayList<>();

            char prev = ' ';
            char start = ' ';
            boolean started = false;
            long cnt = 0;
            long ans = 0;

            for (int i = 0; i < s.length(); i++) {
                char c = s.charAt(i);

                if (!started) {
                    started = true;
                    start = c;
                    prev = c;
                    cnt = 1;
                } else if (c != prev) {
                    list.add(cnt);
                    prev = c;
                    cnt = 1;
                } else {
                    cnt += 1;
                }
            }

            list.add(cnt);

            if (start == 'a') {
                // start from index 0
                long a_cnt = 0;
                long b_cnt;

                for (int i = 0; i + 1 < list.size(); i += 2) {
                    a_cnt += list.get(i);
                    b_cnt = list.get(i + 1);

                    long step = b_cnt * ((pow_mod(2, a_cnt) + BASE - 1) % BASE) % BASE;

                    //out.printf("a_cnt: %d, b_cnt: %d, step: %d\n", a_cnt, b_cnt, step);

                    ans = (ans + step) % BASE;
                }
            } else {
                // start from index 1
                long a_cnt = 0;
                long b_cnt;

                for (int i = 1; i + 1 < list.size(); i += 2) {
                    a_cnt = (a_cnt + list.get(i)) % BASE;
                    b_cnt = list.get(i + 1);

                    long step = b_cnt * ((pow_mod(2, a_cnt) + BASE - 1) % BASE) % BASE;

                    ans = (ans + step) % BASE;
                }
            }

            out.print(ans);
        }

    }

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

        public InputReader(InputStream stream) {
            this.reader = new BufferedReader(new InputStreamReader(stream));
        }

        private String next() {
            while (tokenizer == null || !tokenizer.hasMoreElements()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }

            return tokenizer.nextToken();
        }

        public String nextString() {
            return next();
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void print(long i) {
            writer.print(i);
        }

    }
}

