aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.util.Scanner;

public class B {
	
	public static void main(String[] args) {
		
		Scanner scn = new Scanner(System.in);
		String s = scn.nextLine();
		int sequences = 0;
		
		boolean foundB;
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == 'a') {
				sequences++;
				foundB = false;
				for (int j = i + 1; j < s.length() && (s.charAt(j) == 'b' || s.charAt(j) == 'a'); j++) {
					if (!foundB) {
						foundB = s.charAt(j) == 'b';
					} else if (s.charAt(j) == 'a') {
						sequences++;
					}
				}
			}
		}
		
		System.out.println(sequences % 1000000000 + 7);
		scn.close();
	}
}
