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();
	}

	// **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++;
			}
		}

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

		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();
	}

	static int binomialCoeff(int n, int k) {
		int C[][] = new int[n + 1][k + 1];
		int i, j;

		// Calculate value of Binomial Coefficient in bottom up manner
		for (i = 0; i <= n; i++) {
			for (j = 0; j <= min(i, k); j++) {
				// Base Cases
				if (j == 0 || j == i)
					C[i][j] = 1;

				// Calculate value using previosly stored values
				else
					C[i][j] = C[i - 1][j - 1] + C[i - 1][j];
			}
		}

		return C[n][k];
	}

	// A utility function to return minimum of two integers
	static int min(int a, int b) {
		return (a < b) ? a : b;
	}

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

	public static BufferedReader br = new BufferedReader(r);

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