aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.util.Scanner;

public class C1084C {
    private static final long MOD = 1000000007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String text = sc.next();
        int textLength = text.length();
        long answer = 1;

        long countA = 0;
        int i = 0;
        while (i < textLength) {
            if (text.charAt(i) == 'a') {
                countA = (countA + 1) % MOD;
            } else if (text.charAt(i) == 'b') {
                answer = (answer * (countA + 1)) % MOD;
                countA = 0;
            }
            ++i;
        }

        answer = (answer* (countA + 1))%MOD;
        System.out.println(answer - 1);
    }
}
