aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{   long z=(long)Math.pow(10,9)+7;
	    int i,j,x;
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String s=br.readLine();
		ArrayList<Integer> arr =new ArrayList<Integer>();
		int count=0,n=s.length();
		for(i=0;i<n;i++)
		{   
		    String p=Character.toString(s.charAt(i));
		    if(p.equals("a"))
		        count++;
		    else if(p.equals("b"))
		        {
		            if(count!=0)
		                arr.add(count);
		            count=0;    
		        }
		    if(i==n-1 && count!=0)
		      arr.add(count);
		}
		//System.out.println(arr);
		long ans;
		if(arr.size()>=1)
		    ans=1;
		else
		    ans=0;
		for(int p:arr)
		{
		    ans=(ans*(p+1))%z;
		}
		//System.out.println(ans);
		System.out.println((ans+z-1)%z);
	}
}