aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.util.*;
import java.io.*;

public class Solution {
    public static int mod = 1000000007;
    public static int fact[] = new int[100001];
    public static void calc(int n) {
        fact[0] = 1;
        fact[1] = 1;
        for(int i=2; i<=n; i++) {
            fact[i] = (int)(((long)fact[i-1]%mod * (long)i%mod) % mod); 
        }
    }

    public static void main(String args[]) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
        calc(str.length());
        int seq = 0;
        int noOfA = 0;
        int setsOfB = 0;
        int amount = 0;
        
        for(int i=0; i<str.length(); i++) {
            if(str.charAt(i) == 'a') {
                noOfA++;
                seq = ((seq % mod + 1) % mod + amount) % mod;
            }
                
            if(str.charAt(i) == 'b' && noOfA > 0) {
                setsOfB++;
                amount = ((fact[setsOfB]%mod)%mod * noOfA%mod)%mod;
                noOfA = 0;
            } 
            //System.out.print(amount+" ");
        }
       // System.out.println();
        System.out.println(seq);
    }
}