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 C3 {
	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());
		long ans = 0;

		ArrayList<Integer> al = new ArrayList<>();
		for (int i = 0; i < s.length();) {
			if (s.charAt(i) == 'a') {
				int a = 0;
				while (s.charAt(i) == 'a') {
					a++;
					i++;
					if (i >= s.length())
						break;
				}
				al.add(a);
			} else if (s.charAt(i) == 'b') {
				while (s.charAt(i) == 'b') {
					i++;
					if (i >= s.length())
						break;
				}
			} else {
				i++;
			}
		}

		for (int i = 0; i < al.size(); i++) {
			long curr = ((ans + 1) % mod * al.get(i)) % mod;
			ans += curr;
		}

		System.out.println(ans);
	}

	private static String pre(String s) {
		StringBuilder sb = new StringBuilder("");
		for (int i = 0; i < s.length(); i++)
			if ("ab".contains(s.charAt(i) + ""))
				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);
}
