aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Scanner;

public class C_ {
	public static void main(String[] args) throws Exception {
		solve();
	}

	public static long mod = (long) 1e9 + 7;

	// **SOLUTION**
	public static void solve() throws Exception {
		String s = pre(br.readLine());
		if (s.length() == 0) {
			System.out.println(0);
			return;
		}
		long ans = 0;

		int prev = 0;
		for (int i = 0; i < s.length();) {
			if (s.charAt(i) == 'a') {
				int a = 0;
				while (s.charAt(i) == 'a') {
					ans = (ans + prev + 1) % mod;
					a++;
					i++;
					if (i >= s.length())
						break;
				}
				prev += a;
			} else {
				while (s.charAt(i) == 'b') {
					i++;
					if (i >= s.length())
						break;
				}
			}
		}
		
		System.out.println(ans);
	}

	private static String pre(String s) {
		StringBuilder sb = new StringBuilder("");
		for (int i = 0; i < s.length(); i++)
			if (s.charAt(i) == 'a' || s.charAt(i) == 'b')
				sb.append(s.charAt(i));
		return sb.toString();
	}

	public static InputStreamReader r = new InputStreamReader(System.in);

	public static BufferedReader br = new BufferedReader(r);

	public static Scanner sc = new Scanner(System.in);
}
