aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.util.Scanner;

public class TheFairNutAndString {
    public static void main(String[] args) {
        int ans = 0;
        int last = 0;
        Scanner in = new Scanner(System.in);
        String s = in.next();

        int size = s.length();

        int[] dp = new int[size];
        int amount = 0;
        if (s.charAt(size - 1) == 'b') {
            dp[size - 1] = 1;
        } else {
            dp[size - 1] = 0;
            amount++;
        }
        for (int i = size - 2; i >= 0; i--) {
            if (s.charAt(i) == 'a') {
                amount++;
                dp[i] = dp[i + 1] ;
                last = dp[i];
            } else if (s.charAt(i) == 'b') {
                dp[i] = dp[i + 1] + 1;
            }
        }

        System.out.println((int)((last + amount) % (1e9 + 7)));
    }


}
