aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762


import java.util.*;
 
public class Solution{
    
    
    public static void main(String args[]){
        
        Scanner sc = new Scanner(System.in);
        
      String str = sc.nextLine();
      int count=0;
      char ch[] = str.toCharArray();
         
      for(int i=0;i<ch.length;i++) {
    	  
    	  if(ch[i]=='a') {
    	  count++;
      }
            
    }
      int bc = 0;
      for(int i=1;i<ch.length-1;i++) {
    	  
    	  
    	  if(ch[i]=='b') {
    		  
    		  
    		  bc++;
    		  continue;
    		  
    	  }
    	  
    	  
    	  
    	  
    	  if(ch[i]=='a') {
    		  
    		  count++;
    		  
    	  }
    	  
    	  
    	  if(ch[i]!='a') {
    		  
    		  
    		  break;
    		  
    	  }
    	  
    	  
    	  
    	  
    	  
    	  
    	  
    	  
    	  
    	  
    	  
      }
     int m = (int)(Math.pow(10,9)+7);
      
      System.out.println(count%m);
        
    }
}
  
 
 
 














