aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.io.*;
import java.util.ArrayList;
import java.util.Scanner;

public class CF {

    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TASK solver = new TASK();
        solver.solve(in, out);
        out.close();
    }

    static long MOD = (long)1e9 + 7;

    static class TASK {

        public void solve(Scanner in, PrintWriter out) {

            String line = in.next();
            ArrayList<Character> list = new ArrayList<>();

            for(char c: line.toCharArray()) {
                if (c == 'a' || c == 'b') {
                    list.add(c);
                }
            }

            long ans = 1;
            long cnt = 0;
            for(Character c: list) {
                if(c == 'a') {
                    cnt++;
                } else {
                    if(cnt > 0) {
                        ans *= (cnt + 1);
                        ans %= MOD;
                    }
                    cnt = 0;
                }
            }
            if(cnt > 0)
                ans *= (cnt + 1);
            ans %= MOD;
            ans--;

            out.print(ans);

        }

    }

}
