aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.util.*;

public class Test {

    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        String s = in.next();
        long ans = 1, cnt = 0;
        boolean ls = false;

        for(int i = 0; i<s.length(); i++){
            ls = false;
            if(s.charAt(i)=='a'){
                cnt++;
            }
            else if(s.charAt(i)=='b'){
                ans*=(cnt+1);
                cnt = 0;
                ls = true;
            }
        }
        if(!ls) ans*=(cnt+1);
        System.out.println((ans-1)%1000000007);
    }

}