aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.util.Scanner;

public class Solutiona {

		public static void main(String args[])
		{
			Scanner scan=new Scanner(System.in);
			String g=scan.next();
			int a[]=  new int[100005];
			int b[]=  new int[100005];
			int tot[]=new int[100005];
			int dp[]= new int[100005];
		int pre=0;
		int count=0;
		count=1;
			int mod=1000000007;
		for(int i=0;i<g.length();i++)
		{
			if(g.charAt(i)=='a')
			{
				a[i]=1;
				b[i]=-1;
				dp[count]=1;
				dp[count]+=tot[pre];
				dp[count]%=mod;
				tot[count]+=tot[count-1]+dp[count];
				tot[count]%=mod;
				count++;
			}else if(g.charAt(i)=='b')
			{
				pre=count-1;
			}
			
		}
		System.out.println(tot[count-1]);
		}
		
}