aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.io.*;
import java.util.*;

public class C526 {

	public static void main(String[] args) throws Exception{
		BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
		
		String s = f.readLine();
		
		ArrayList<Integer> groups = new ArrayList<Integer>();
		
		int curr = 0;
		for(int i = 0;i<s.length();i++) {
			if(s.charAt(i) == 'a') {
				curr ++;
			}
			if(s.charAt(i) == 'b' && curr != 0) {
				groups.add(curr);
				curr = 0;
			}
		}
		if(curr != 0) {
			groups.add(curr);
		}
		
		long ans  = 1;
		for(int i = 0;i<groups.size();i++) {
			ans*= (groups.get(i) + 1) %(1e9 + 7);
		}
		System.out.println(ans - 1);
	}

}
