aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.util.Scanner;

public class ProblemC {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();
		int l = s.length();
		long mod = (long)Math.pow(10, 9) + 7;
		StringBuilder sb = new StringBuilder();
		boolean flag = false;
		for(int i = 0; i < l; i++) {
			char c = s.charAt(i);
			if(c == 'a') {
				flag = true;
				sb.append("a");
			}else if(c == 'b' && flag) {
				sb.append("b");
			}
		}
		String[] s1 = sb.toString().split("bb*");
		long ans = 1;
		for(String t : s1) {
			ans *= new Long(t.length() + 1);
			ans %= mod;
		}
		System.out.println(ans - 1);
	}
}