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 = 10e9+7;
		int acounter=0;
		int answer = 1;
		
		ArrayList<Integer> combinations = new ArrayList<Integer>();
		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>=1)								
					combinations.add(acounter);	
				acounter=0;
			}					
		}
		
		 combinations.add(acounter);
		 
		
		for(int a : combinations)			
			answer = (int) (answer *(a+1) % mod);
		
		
		System.out.println(answer-1);
	
		
	}
}