aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

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


public class mymy
{	



	static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));	

	static long mod=1000000007;



	
	
	public static void main(String[] args)throws IOException{
		
		
		String s=br.readLine();
		int n=s.length();

		ArrayList<Integer> a=new ArrayList<Integer>();
		int temp=0;
		for(int i=0;i<n;i++)
		{
			if(s.charAt(i)=='a')
				temp++;
			if(s.charAt(i)=='b')
			{
				if(temp!=0)
					a.add(temp);
				temp=0;
			}
		}
		if(temp!=0)
			a.add(temp);
		long tot=1;
		for(int i=0;i<a.size();i++)
		{
			a.set(i,a.get(i)+1);
			tot*=a.get(i);
			tot%=mod;
		}
		tot-=1;
		if(tot<0)
			tot+=mod;

			

		System.out.println(tot%mod);
		
	}

	

	
 
}