aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

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

/* Name of the class has to be "Main" only if the class is public. */
public class main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		long m = 1000000007, res = 1;
		Scanner in = new Scanner(System.in);
		String s = in.nextLine(); String s1 = ""; 
		for(int i = 0; i < s.length(); i++){
			if(s.charAt(i) =='a' || s.charAt(i) =='b') s1 += s.charAt(i);
		}
		for(int i = 0; i < s1.length();){
			if(s1.charAt(i) =='a') {
				int c=0;
				while(i < s1.length() && s1.charAt(i) =='a') {
					c++; i++;
				}	
				res=(res*(c+1)) % m;
			} else i++;	
		}
	System.out.println((--res)%m);
	}
}