aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.util.ArrayList;
import java.util.Scanner;
public class runner {

	
	public static void main(String[] args) {

		double mod = 10e8+7;
		long acounter=0;
		long answer = 1;
		long sum = 0;
		ArrayList<Long> combinations = new ArrayList<Long>();
		StringBuilder sb = new StringBuilder();	
		Scanner scan = new Scanner(System.in);
		sb.append(scan.nextLine());
		
		for(int i=0;i<=sb.length()-1;i++)
		{
			char tempChar = sb.charAt(i);				
			if(tempChar=='a') acounter++;
			if(tempChar=='b') 
			{
				if(acounter>0)								
					combinations.add(acounter);	
				acounter=0;
			}					
		}
		if(acounter!=0)
				combinations.add(acounter);
		 
		//calculate the number of combinations possible
		for(long a : combinations)
			{
				sum+=a;
				answer += (long) (answer *(a));
			}			
			
		long finalAnswer = (long)(((answer-1))% mod);
		System.out.println(finalAnswer);
	
		
	}
}