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.Arrays;
import java.util.List;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
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 k = 0;
            for (int i = 0; i < chars.length; i++) {
                if (chars[i] == 'a' || chars[i] == 'b') {
                    chars[k++] = chars[i];
                }
            }
            chars = Arrays.copyOf(chars, k);
            int curAAmount = 0;
            List<Long> ans = new ArrayList<>();
            for (int i = 0; i < chars.length; i++) {

                if (chars[i] == 'a') {
                    curAAmount++;
                }
                if ((curAAmount != 0 && chars[i] == 'b') || i == chars.length - 1) {
                    ans.add(curAAmount + 1L);
                    curAAmount = 0;
                }
            }

            out.println(GeekMath.multiplication(mod, ans) - 1);
        }

    }

    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();
        }

    }

    static class GeekMath {
        public static long multiplication(long modulo, List<Long> list) {
            long[] arr = new long[list.size()];
            int k = 0;
            for (long i : list) {
                arr[k++] = i;
            }
            return multiplication(modulo, arr);
        }

        public static long multiplication(long modulo, long... arr) {
            long ans = 1;
            for (long l : arr) {
                ans *= l;
                ans %= modulo;
            }
            return ans;
        }

    }
}

