aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

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

public class Solution {
    public static void main(String[] args)throws IOException {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        long mod = 1000000007;
        LinkedList<Long> al = new LinkedList<Long>();
        long cnt = 0;
        for(int i=0;i<s.length();i++){
            char c = s.charAt(i);
            if(c=='a') cnt++;
            if(cnt==0) continue;
            if(c=='b'){ al.addLast(cnt); cnt=0;}
        }
        if(cnt!=0) al.addLast(cnt);
        if(al.isEmpty()) System.out.println("0");
        else{
            long res = al.removeFirst();
            while(!al.isEmpty()){
                long d = 1+res;
                d *= al.removeFirst();
                d%=mod;
                res+=d;
                res%=mod;
            }
            System.out.println(res);
        }
    }
}