aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

// package Dynamic;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class FairNut {
    public static void main(String[] args)throws IOException {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        String str=br.readLine();
//        long dp[]=new long[str.length()+1];
        long ans=0;
//        boolean seen_b=false;
        int mod=1000000007;
        int n=str.length();
        long ans_seenb=0;
        for(int i=n-1;i>=0;i--){
            if(str.charAt(i)=='b'){
//                seen_b=true;
                ans_seenb=ans;
                continue;
            }
            if(str.charAt(i)=='a'){
                ans+=ans_seenb+1;
                ans=ans%mod;
//                seen_b=false;
            }
        }
        System.out.println(ans);
    }
}
