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.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public final class TheFairNutStringCF {
    public  static  int mod= (int) (1e9+7);
    public static void main(String[] args) throws IOException {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        String s=br.readLine();
        StringBuilder sb=new StringBuilder(s);
        int i=0;
        while (i<sb.length()){
            if(sb.charAt(i)!='a' && sb.charAt(i)!='b'){
                sb.replace(i,i+1,"");
            }else
                i++;
        }
        ArrayList<Integer> l=new ArrayList<>();
        int start=0;
        while (start<sb.length()){
            int cnt=0;
            while (start<sb.length() && sb.charAt(start)=='a'){
                start++;
                cnt++;
            }
            if(cnt>0) l.add(cnt);
            start++;
        }
        if(l.size()==0)
            System.out.println("0");
        else{
            long ans=1;
            for (int ii=0;ii<l.size();ii++){
                long curr=l.get(ii)+1;
                ans=(ans*curr)%mod;
            }
            System.out.println(ans-1);
        }
    }
}
