aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

//package dec18;

import java.util.Scanner;

public class FairNutString1084C {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		String str=scn.next();
		long ans=0;
		long MOD = 1000000000+7;
		String str1="";
		int countb=0;
		for(int i=0; i<str.length(); i++)
		{
			if(str.charAt(i)=='a' || str.charAt(i)=='b')
			{
				str1+=str.charAt(i);
			}
			if(str.charAt(i)=='b')
			{
				countb++;
			}
		}
		int counta=str.length()-countb;
		str=str1;
		//System.out.println(str);
		for(int i=0; i<=str.length()-1; i++)
		{
			if(str.charAt(i)=='a')
			{
				ans=(ans%MOD+1)%MOD;
			}
			if(i>0 && i<str.length()-1 && str.charAt(i)=='b' && str.charAt(i-1)=='a')
			{
			//	System.out.println(i);
				countb=countb-1;
				int countaright=str.length()-1-i-countb;
				int countaleft=str.length()-countaright-countb-1;
				int ans1=countaleft*countaright;
				ans=ans+(ans1)%MOD;

				
			}
		}
		System.out.println(ans%MOD);
		

	}

}
