aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.io.*;
import java.util.*;
import static java.lang.Integer.*;
//import static java.lang.Long.*;

public class D3 {
	static long mod=(long)1e9+7;
	static StringBuilder sb;
	static void msba(int arr[]) {
		msb();
		int arrLength=arr.length;
		for(int i=0;i<arrLength;i++)
			sb.append(arr[i]+" ");
	}
	
	static void msb() {
		sb=new StringBuilder("");
	}
	
	
	public static void main(String[] args) throws IOException{
		
		BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
		
		int t=1;
//		int t=parseInt(in.readLine());
		while(t-->0){
			String s=in.readLine();
			int n=s.length();
			ArrayList<Integer> alist=new ArrayList<>(); int count=0;
			for(int i=0;i<n;i++) {
				char ch=s.charAt(i);
				if(ch=='a')
					count++;
				if(ch=='b') {
					alist.add(count);
					count=0;
				}
			}
			if(count!=0)
				alist.add(count);
//			System.out.println(alist);
			long ans=1; long mod=(long)1e9+7;
			for(int x:alist)
				ans=(ans*(x+1))%mod;
			
			System.out.println(ans-1);
		}
	}
}






