aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner leer=new Scanner(System.in);
		String cad=leer.next();
		long res=0, ant=0;
		int m=1000000007;
		for(int i=0; i<cad.length(); i++) {
			char c=cad.charAt(i);
			if(c=='a') {
				res=(res+1+ant)%m;
			}
			else if(c=='b') {
				ant=res;
			}
		}
		System.out.println(res);
		

	}

}
