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  The_Fair_Nut_and_String
{
	public static void main(String[] args) throws IOException 
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw=new PrintWriter(System.out);

		int t=1;

		while(t-->0)
		{

			char a[]=br.readLine().trim().toCharArray();
			int n=a.length;
			long count=0;
			ArrayList<Long> li=new ArrayList<>();
			for(int i=0;i<n;i++)
			{
				if(a[i]=='a')
					count++;

				if(a[i]=='b')
				{
					if(count>0)
						li.add(count);
					count=0;
				}
			}
			if(count>0)
				li.add(count);

			long mod=1000000007;

			if(li.isEmpty())
			{
				System.out.println(0);
				System.exit(0);
			}

			long ans=li.get(0)%mod;
			n=li.size();

			for(int i=1;i<n;i++)
			{
				ans=((ans*li.get(i))%mod + ans%mod + li.get(i)%mod )%mod;
			}

			pw.println(ans);
		}
		pw.flush();
	}

	
}