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 MyClass {
static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    } 
    public static void main(String args[]) 
{
	FastReader s=new FastReader();int t=0,n=0;
     //Scanner in=new Scanner(System.in);
     //if(in.hasNext())
     String st=s.next();
     int count=0;
     ArrayList<Integer> al=new ArrayList<>();
     for(int i=0;i<st.length();i++)
     {
         char ch=st.charAt(i);
         if(ch=='a')
         {
             count++;
         }
         else if(ch=='b')
         {
             //if(count!=0)
             //{
             al.add(count);
             count=0;
             //}
         }
     }
    
     al.add(count);count=0;
     
     int prod=1;
     int p=1000000007;
     for(int i=0;i<al.size();i++)
     {
         prod=((prod%p)*((al.get(i)%p+1%p)%p)%p)%p;
     }
     
     prod=(prod%p - 1%p)%p;
     //System.out.println(al.toString());
     System.out.println(prod);
    }
}