aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.util.*;
public class Solution{
    public static void main(String[] args){
        
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int n = s.length();
        long M = (long) Math.pow(10,9) + 7;
        
        long a=0, b=0;
        
        for(int i=0;i<n;i++){
            
            if(s.charAt(i)=='b'){
                b = a;
            }else if(s.charAt(i)=='a'){
                
                a += b + 1;
                a %= M;
                
            }
            
        }
        
        System.out.println(a);
        
    }
}