aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.math.BigInteger;
import java.util.*;

public class Test {

    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        String s = in.next();
        long cnt = 1;
        BigInteger ans = new BigInteger("1");

        for(int i = 0; i<s.length(); i++){
            if(s.charAt(i)=='a') cnt++;
            else if(s.charAt(i)=='b'){
                ans = ans.multiply(BigInteger.valueOf(cnt));
                cnt = 1;
            }
        }
        if(s.charAt(s.length()-1)!='b') ans = ans.multiply(BigInteger.valueOf(cnt));
        System.out.println(ans.subtract(BigInteger.ONE).mod(new BigInteger("1000000007")));
    }

}