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 fairnutstring{
   public static void main(String[] args) throws Exception {
      BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
      Scanner scan = new Scanner(System.in);
      PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
      String s = bf.readLine();
      long sum=1;
      long curra=0;
      for(int i=0; i<s.length(); i++){
      
         if(s.charAt(i)=='a'){
            curra++;
         }
         else if(s.charAt(i)=='b'){
            sum=sum*(curra+1)%1000000007;
            curra=0;
         }
      }
      sum = sum*(curra+1)%1000000007;
      out.println(sum-1);
      out.close();
   
   }
}
