aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

import static java.lang.System.in;
import static java.lang.System.out;

public class Main {

    private static Scanner cin;
    private static final long MOD = 1_000_000_000 + 7;

    static {
        cin = new Scanner(in);
    }

    public static void main(String[] args) {
        char[] sourceArray = cin.next().toCharArray();

        List<Long> separatedA = new ArrayList<>();
        boolean isFirstB = true;

        long sum = 0;
        for (char c : sourceArray) {
            if (c == 'a') {
                isFirstB = true;
                sum++;
            } else if (isFirstB && c == 'b') {
                separatedA.add(sum);
                sum = 0;
                isFirstB = false;
            }
        }
        separatedA.add(sum);

        long result = separatedA.stream()
                .filter(x -> x > 0)
                .map(x -> x + 1)
                .reduce((a,b) -> (a*b) % MOD)
                .orElse(1L);

        if (result == 0) {
            result = MOD - 1;
        }



        out.println(result - 1);
    }
}
