aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

//codeforces_1084C_live

import java.io.*;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static java.lang.Math.*;
import java.math.*;

public class Main{

	static PrintWriter go = new PrintWriter(System.out);
	static long mod = 1000000007;

	public static void main(String args[]) throws IOException,FileNotFoundException {
		BufferedReader gi = new BufferedReader(new InputStreamReader(System.in));
		char[] s = gi.readLine().toCharArray();
		long ss = 0;
		long ans = 0;
		ArrayList<Long> v = new ArrayList<>();
		for (char j : s) {
			if (j == 'b') {
				if (ss > 0) {
					v.add(ss);
					ss = 0;
				}
			} else if (j == 'a') {
				ss++;
			}
		}
		if ( ss > 0 ){ v.add(ss); }
		ans = v.isEmpty()?0:v.get(0);
		for (int k = 1; k < v.size(); ++k) {
			ans = ans * v.get(k) + v.get(k) + ans;
			ans %= mod;
		}
		go.println(ans);

		go.close();
	}

	static int[] parseArray(BufferedReader gi) throws IOException{
		String[] line = gi.readLine().trim().split(" ");
		int[] rez = new int[line.length];
		for ( int k = 0; k < line.length; k++){
			rez[k] = Integer.parseInt(line[k]);
		}
		return rez;
	}

}
