aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.util.Scanner;

public class er {
    public static void main(String[] args) {


        Scanner scanner = new Scanner(System.in);
        String string = scanner.nextLine();
        int[] t = new int[1000001];
        for (int i = 0; i < t.length; i++) {
            t[i] = 1;
        }
        int j = 0;
        for (int i = 0; i < string.length(); i++) {
            if (string.charAt(i) == 'b') {
                j++;
            } else if (string.charAt(i) == 'a') {
                t[j] += 1;
            }
        }
        long res;
        res = 1;
        for (int i = 0; i < t.length; i++) {
            res *= t[i];
            res = res %1000000007;
            //System.out.println(res);
        }

        /*for (int i=0;i<t.length;i++){
            System.out.println(t[i]);
        }*/
        System.out.println(res - 1);


    }

}