aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.util.*;
public class main{
    public static void main(String args[]){
        Scanner sc=new Scanner(System.in);
        String s=sc.next();
        char str[]=s.toCharArray();
        int n=str.length;
       int ac[]=new int[n];
       long ans=0l;
       int lac=0;
       int mod=1000000007;
       for(int i=0;i<n;i++){
           char ch=str[i];
           if(ch == 'b'){
               ac[i]=i>0?ac[i-1]:0;
               lac=ac[i];
           }
           else if(ch == 'a'){
               ans=(ans+((lac)%mod))%mod;
               ac[i]=i>0?ac[i-1]+1:1;
           }
           else{
               ac[i]=i>0?ac[i-1]:0;
           }
        //   System.out.println("lac "+lac);
           
       }
    //   for(int i:ac) System.out.print(i+" ");
    //   System.out.println();
        ans=(ans+ac[n-1])%mod;
        System.out.println(ans);
    }
}