aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

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
 *
 * @author dmytro.prytula
 */
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);
        COrehusIStroka solver = new COrehusIStroka();
        solver.solve(1, in, out);
        out.close();
    }

    static class COrehusIStroka {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int mod = (int) 1e9 + 7;
            String s = in.nextToken();

            char[] chars = s.toCharArray();

            int all = 0;
            int cur_counter = 0;
            int ans = 1;
            int claster = 0;
            for (int i = 0; i < chars.length; i++) {
                if (chars[i] == 'a') {
                    all++;
                }

                if (chars[i] == 'a') {
                    if (cur_counter == 0) {
                        claster++;
                    }
                    cur_counter++;
                }

                if (cur_counter != 0 && chars[i] == 'b') {
                    ans *= cur_counter;
                    ans %= mod;
                    cur_counter = 0;
                    claster++;
                }
            }

            if (claster > 2 && cur_counter != 0) {
                ans *= cur_counter;
                ans %= mod;
            }


//
//        int a_amount = 0;
//        int ans = 0;
//        long[] a_prefixes = new long[s.length()];
//        long[] a_sufixed = new long[s.length()];
//
//        a_prefixes[0] = chars[0] == 'a' ? 1 : 0;
//        for (int i = 1; i < chars.length; i++) {
//            a_amount += chars[i] == 'a' ? 1 : 0;
//            a_prefixes[i] = a_prefixes[i - 1] + a_amount;
//        }
//
//        a_sufixed[chars.length - 1] = chars[chars.length - 1] == 'a' ? 1 : 0;
//        for (int i = chars.length - 2; i >= 0; i--) {
//            a_sufixed[i] = a_sufixed[i + 1] + (chars[i] == 'a' ? 1 : 0);
//        }
//
//        for (int i = 0; i < chars.length; i++) {
//            if (chars[i] == 'b') {
//                ans += (GeeksMath.bin_pow_mod(2, a_prefixes[i], mod)
//                        * GeeksMath.bin_pow_mod(2, a_sufixed[i], mod)) % mod;
//            }
//        }
//
            if (ans == 1) ans = 0;
            out.println((ans + all) % mod);
        }

    }

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

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String nextToken() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

    }
}

