aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.util.*;
public class waw{
        
   
    
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long M = ((long) Math.pow(10,9)) + 7;
        
       LinkedList<Long> a = new LinkedList<Long>();
       long nb=0;
       for(int i=0;i<s.length();i++){
           if(s.charAt(i)=='b'){
               if(nb!=0) a.add(nb);
               nb = 0;
           }
           else if(s.charAt(i)=='a') nb++;
       }
       if(nb!=0) a.add(nb);
       long rep = 0;
       long v;
       while(!a.isEmpty()){
           v = a.poll();
           rep += v*(rep+1);
           rep %= M;
       }
       System.out.println(rep);
    }
    
    
    
}