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;
		for (int i = 0; i < s.length(); i++)
			if (s.charAt(i) == 'a')
				ans++;

		ArrayList<CH> al = new ArrayList<>();
		
		for (int i = 0; i < s.length();) {
			char ch = s.charAt(i);
			int c = 0;
			if (ch == 'a') {
				while (ch == 'a') {
					c++;
					i++;
					if(i>=s.length())
						break;
					ch = s.charAt(i);
				}
				al.add(new CH('a', c));
			} else {
				if (al.size() != 0)// dont add b in start
					al.add(new CH('b', 0));
				while (ch == 'b') {
					i++;
					if(i>=s.length())
						break;
					ch = s.charAt(i);
				}
			}
		}

		System.out.println(al);
		
		for (int i = 0; i < al.size(); i++) {
			if (i == 0)
				continue;
			CH curr = al.get(i);
			CH prev = al.get(i - 1);
			curr.aans = (prev.aans + prev.count) % mod;
		}

		for (int i = 0; i < al.size(); i++) {
			ans = (ans + (al.get(i).aans * al.get(i).count) % mod) % mod;
		}
		System.out.println(ans);
	}

	public static class CH {
		char ch;
		int count = 0;
		long aans = 0;

		public CH(char ch, int count) {
			this.ch = ch;
			this.count = count;
		}

		public String toString() {
			return this.ch + " " + this.count + " => " + this.aans;
		}
	}

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