aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.util.*;
import java.io.*;
public class a{

    static Scanner sc=new Scanner(System.in);
    public static void main(String [] args){
       String s=sc.next();
       List<Character> ch=new ArrayList<>();
       for(int i=0;i<s.length();i++){
           if(s.charAt(i)=='a'){
               ch.add('a');
           }
           else if(s.charAt(i)=='b'){
              int j=i;
              while(j<s.length() && s.charAt(j)=='b'){
                  j++;
              }
              i=j-1;
               ch.add('b');
           }
       }

       StringBuilder ss=new StringBuilder("");
       for(int i=0;i<ch.size();i++){
           ss.append(ch.get(i));
       }

       long mod=1000*1000*1000+7;

       String [] data=ss.toString().split("b");
    //    System.out.println(ss.toString());
       long ans=1;
       for(int i=0;i<data.length;i++){
           ans=(ans*(data[i].length()+1)%mod);
       }
       System.out.println(ans-1);
  }
}