aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

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

/**
 *  candidate master
 */
public class GFG {
        static  String makePerfect(String input){
            StringBuffer sbuff = new StringBuffer(input);
            for(int i = 0 ; i + 1 < sbuff.length() ; i++ ){
                if(sbuff.charAt(i) == 'b' && sbuff.charAt(i) == sbuff.charAt(i+1)) {
                    sbuff.deleteCharAt(i+1);
                    i--;
                }
            }
            return sbuff.toString();
        }
    public static void main (String[] args) {
            Reader reader = new Reader();
            String str = makePerfect(reader.readString());
            long mod  = 1000000007, cnt = 0, ans = 0;
            for(int i = 0 ; i < str.length() ; i++ ){
                    if(str.charAt(i) == 'b'){
                        ans = ((ans + (ans*cnt)%mod)%mod  + cnt%mod )%mod;
                        cnt = 0;
                    }else if(str.charAt(i) == 'a'){
                        cnt++;
                    }
            }
            if(cnt != 0)
                ans = ((ans + (ans*cnt)%mod)%mod  + cnt%mod )%mod;

            System.out.print(ans);
        }
    static  class Reader{
        BufferedReader buff;
        StringTokenizer st;
        public Reader(){
            buff = new BufferedReader(new InputStreamReader(System.in));
        }
        public String getString(){
            try{
                if(st == null || !st.hasMoreTokens())
                    st = new StringTokenizer(buff.readLine());
            }catch(IOException e){
                System.out.println("ERROR in Input");
            }
            return st.nextToken();
        }
        public int readInt(){
            return Integer.parseInt(getString());
        }
        public Long readLong(){
            return Long.parseLong(getString());
        }
        private String readString(){
            String str = null ;
            try{
                str = buff.readLine();
            }catch(IOException e){
                System.out.println("ERROR in Input");
            }
            return str;
        }
    }
}