We have a string of letters 'a' and 'b'. We want to perform some operations on it. On each step we choose one of substrings "ab" in the string and replace it with the string "bba". If we have no "ab" as a substring, our job is done. Print the minimum number of steps we should perform to make our job done modulo 109 + 7.

The string "ab" appears as a substring if there is a letter 'b' right after the letter 'a' somewhere in the string.

Input

The first line contains the initial string consisting of letters 'a' and 'b' only with length from 1 to 106.

Output

Print the minimum number of steps modulo 109 + 7.

Examples

Input

ab


Output

1


Input

aab


Output

3

Note

The first example: "ab"  →  "bba".

The second example: "aab"  →  "abba"  →  "bbaba"  →  "bbbbaa".
import java.util.*;
import java.lang.*;
import java.io.*;

/*
 * 
 * Comments Here
 * 
 */
public class D2
{
	static BufferedReader br; 
	static BufferedWriter bw; 
	static StringTokenizer st;
	
	static final int mod = 1000000007;
	static char[] chars;
	
	static long prevPow = 0;
	static long prevAns = 1;

	public static void main(String[] args) throws java.lang.Exception
	{
		br = new BufferedReader(new InputStreamReader(System.in));
		bw = new BufferedWriter(new OutputStreamWriter(System.out));
    	//Uncomment to read from file
    	/*/
    	File file = new File("src/in.txt");
		try {
			in = new Scanner(file);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		/**/
		
		
//		String arep = "a";
//		String brep = "b";
//		
//		String test = String.join("", Collections.nCopies(500000, arep));
//		test += String.join("", Collections.nCopies(500000, brep));
		
//		System.out.println(test);

		chars = br.readLine().toCharArray();
//		chars = test.toCharArray();
		long acount = 0;
		long bcount = 0;
		
		
		char prev = 'b';
		
		long ans = 0;
		
		for(int i = 0; i < chars.length; ++i) {
			
			if(chars[i] == 'a') {
				if(prev == 'a') {
					++acount;
				} else {
					ans += fab(acount, bcount);
					ans %= mod;
					bcount = 0;
					prev = 'a';
					++acount;
				}
			} else {
				if(prev == 'b') {
					++bcount;
				} else {
					prev = 'b';
					bcount = 1;
				}
			}
			
		}
		
		if(bcount > 0) {	
			ans += fab(acount,bcount);
			ans %= mod;
		}
		
		bw.write(ans+"\n");
		
		br.close();
		bw.close();
	}
	

	static long fab(long a, long b) {
		
		
		
		long aterm = prevAns*(expMod1(2,a-prevPow))%mod;
		prevPow = a;
		prevAns = aterm;
		return ((aterm-1)*b%mod)%mod;
		
	}
	
	
	static long expMod1(int value , long power){
	    long e = 1;
	    
	    for (int i = 0; i < power; i++) {
	         e = ((e * value) % mod);
	            
	    }
	        return e;
		}
	}

