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 Main {

	public static void main(String[] args) throws Exception{
		BufferedReader  jk =  new BufferedReader(new InputStreamReader( System.in))  ; 
		PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out)) ; 
		//StringTokenizer ana = new StringTokenizer(jk.readLine()) ;
		long mod= (long) (Math.pow(10,9) + 7) ; 
		String ss  = jk.readLine() ; 
		int n = ss.length() ;
		long count[] = new long[n] ; 
		char s[] = ss.toCharArray() ; 
		long cum = 0 ;
		int lastindex = -1;
		if(s[0]=='a')
		{
			count[0]=1 ; lastindex=0 ; 
		}
		for(int i=1 ; i< n ;i++)
		{
			if(s[i]=='a')
			{
				count[i]=(1+count[i-1]+cum) ;
				count[i]%=mod ;
				lastindex = i ; 
			}
			else count[i]= count[i-1] ; 


			if(s[i]=='b' )
			{
				if(lastindex!=-1) cum = count[lastindex] ; 
			}

		}
		System.out.println(count[n-1]);






		out.flush();
	}
}


