aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;



public class Main {
	public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(1, in, out);
        out.close();
    }

	static class P implements Comparable<P> {

		int a;
		int b;
		
		@Override
		public int compareTo(P arg0) {
			if(arg0.a > this.a) return 1;
			else return -1;
		}
	}
	static class Task {
		static final int maxl = 200020;
		static final int mod = 1000000007;

		public void solve(int testNumber, InputReader in, PrintWriter out) {
        	String string = in.next();
        	string +='e';
        	int len = string.length();
        	int lena = 0;
        	int lenb = 0;
        	P p[] = new P[len];
        	for(int i=0;i<len;i++) p[i] = new P(); 
        	int res = 0;
        	for(int i=0;i<len-1;i++) {
        		if(string.charAt(i) == string.charAt(i+1)) {
        			if(string.charAt(i) == 'a') lena++;
        			else if(string.charAt(i) == 'b') lenb++;
        		} else if(string.charAt(i) == 'a') {
        			lena++;
        			p[res].b = 0;
        			p[res++].a = lena;
        			lena = 0;
        		} else if(string.charAt(i) == 'b') {
        			lenb++;
        			p[res].b = 1;
        			p[res++].a = lenb;
        			lenb = 0;
        		} else {
        			lena = 0;
        			lenb = 0;
        		}
        	}
        	int ans[] = new int[len];
        	int index = 0;
        	for(int i=0;i<res;i++) {
        		if(p[i].b == 0) {
        			int temp = i;
        			while(i<res - 1 && p[i+1].b==0) {
        				p[temp].a += p[i+1].a;
        				i++;
        			}
//        			int cnt = 0;
//        			while(i<res - 1 && p[i+1].b==1) {
//        				i++;
//        				cnt++;
//        			}
//        			if(cnt>1) {
//        				while(i<res - 1 && p[i+1].b==0) {
//            				p[temp].a += p[i+1].a;
//            				i++;
//            			}
//        			}
        			ans[index++] = p[temp].a;
        		}
        	}
//        	for(int i=0;i<index;i++) {
//        		out.println(ans[i]);
//        	}

        	if(index == 1) {
        		out.println(ans[0]);
        	} else {
        		long sum = 1;
	        	for(int i=0;i<index;i++) {
	        		sum*=(long)(ans[i]+1);
	        		sum%=mod;
	        	}
	        	sum--;
	        	out.println(sum);
        	}
        }
    }
	static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;
        
        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        
        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}