aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.util.Scanner;

public class Task1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s=in.next();
        int a[]=new int[s.length()];
        int t=0;
        for (int i = 0; i <s.length() ; i++) {
            if(s.charAt(i)=='a'){a[t]++;}
            if(s.charAt(i)=='b') {t++;}
        }
        long k=1;
        for (int i = 0; i <s.length() ; i++) {
             k*=(a[i]+1);
            k%=1000000007;
        }
        k--;
        if(k<0){ k+=1000000007;}
        System.out.print(k);
    }
}