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;

public class A {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        String s = input.next();
        char[] m = s.toCharArray();
        List<Integer> a = new ArrayList<>();
        int c = 0;
        for(int i=0;i < m.length; i++) {
            if (m[i] == 'a') {
                c++;
            }
            if (m[i] == 'b' && c > 0) {
                a.add(c);
                c=0;
            }
        }
        if ( c> 0) {
            a.add(c);
        }
        if ( a.isEmpty()) {
            System.out.println(0);
            return;
        }
        long res =1;
        for(int i : a) {
            res = (res * (i+1)) % 1000000007;
        }
        res = (res - 1) % 1000000007;
        System.out.println(res);
        return;
    }
}
