aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

//package Codeforces;
import java.util.*;

public class string {
	static char[] s;
	static long[] memo;
	static long mod = 1000000000 + 7;
	static TreeSet<Integer> blocs;
	
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		s = in.next().toCharArray();
		memo = new long[s.length+1];
		Arrays.fill(memo, (long)-1);
		blocs = new TreeSet<Integer>();
		for(int i=0; i<s.length; i++)
			if(s[i] == 'b')
				blocs.add(i);
		blocs.add(s.length);
		System.out.println(dp(0)-1);
		
	}
	
	static long dp(int idx) {
		if(idx >= s.length)
			return 1;
		if(memo[idx] != -1)
			return memo[idx];
		if(s[idx] != 'a')
			return memo[idx] = dp(idx+1);
		long r = dp(idx+1) + dp(blocs.higher(idx));
		return memo[idx] = r%mod;
	}

}
