aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.util.*;
import java.lang.*;

public class a{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        char[] arr = s.toCharArray();
        long a = 0, b = 0, state = 0;
        for(int i = 0; i < s.length(); i++){
            if(state == 0){
                if(arr[i] == 'a'){
                    a++;
                } 
                if(arr[i] == 'b'){
                    if(a != 0){
                        b++;
                        state = 1;
                        continue;
                    }
                }
            }else if(state == 1){
                if(arr[i] == 'a'){
                    a += b+1;
                    b = 0;
                    state = 0;
                } 
                if(arr[i] == 'b'){
                    b++;
                }
            }
        }
        System.out.println(a%1000000007);
    }
}