aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.util.*;
public class c {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String s = in.next();
		ArrayList<Integer> a = new ArrayList<Integer>();
		int counta = 0;
		for(char i:s.toCharArray()) {
			if(i=='a')counta++;
			if(i=='b') {
				a.add(counta);
				counta =0;
			}
		}
		a.add(counta);
		long x=1;
		for(int i:a) {
			x = (x*(i+1))%1000000007;
		}
		System.out.println(x-1);
	}
}
