aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
//package codeforces;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */


import java.util.Arrays;
import java.util.Scanner;

/**
 *
 * @author Amr Elkady
 */
public class CodeForces {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        
        Scanner sc= new Scanner(System.in);
        
        String s=sc.nextLine();
        
        int counterA=0;
        long resuelt=1;
        char c[]=s.toCharArray();
        
        for(int i=0 ;i<s.length();i++)
        {
            if(c[i]=='a')
            {
                    counterA++;
            
                   // System.out.println("here");
            }
            else if(c[i]=='b')
            {
                resuelt*=(counterA+1)%1000000007;
                counterA=0;
               // System.out.println(resuelt);
            }
        }
        
        System.out.println((long)(resuelt*(counterA+1)-1)%1000000007);
        
        
      
        
        
       
        
        
    }
    
    
}