aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.util.Scanner;

public class Main {
    private static final long MODULA = 1_000_000_007;
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.next();
        long[][] dp = new long[2][str.length()];
        if (str.charAt(0) == 'a') dp[0][0]++;

        for (int i = 1 ;  i < str.length() ; ++i) {
            char cur = str.charAt(i);
            switch (cur) {
                case 'a' : dp[0][i] = (dp[0][i - 1] + dp[1][i - 1] + 1 + MODULA) % MODULA; dp[1][i] = dp[1][i - 1]; break;
                case 'b' : dp[1][i] = dp[0][i - 1]; dp[0][i] = dp[0][i - 1]; break;
                default: dp[0][i] = dp[0][i - 1]; dp[1][i] = dp[1][i - 1];
            }
        }
        System.out.println(dp[0][str.length() - 1]);
    }
}