aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try(Scanner input = new Scanner(System.in)){
			String s = input.nextLine();
			long mod = 1000000007;
			long resp = 1;
			int count = 1;
			for(int i = 0; i < s.length();i++) {
				if(s.charAt(i)=='a') {
					count++;
				}else if(s.charAt(i)=='b') {
					resp = calculateMOD(resp*count,mod);
					count = 1;
				}
			}
			resp = calculateMOD(resp*count,mod);
			System.out.println(resp-1);
		}
	}
	private static long calculateMOD(long n, long mod) {
		return ((n%mod)+mod)%mod;
	}
}