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.io.*;
import java.util.*;
public final class code
{
	static final long mod=(long)(1e9+7);
	static long pow(int a,int b)
	{
		if(b==0)
			return 1;
		long x=pow(a,b/2);
		x=(x*x)%mod;
		if(b%2==0)
			return x;
		else
			return (x*a)%mod;
	}
	static void solve()throws IOException
	{
		String s=nextLine();
		int n=s.length();
		int i=0;
		long ans=0;
		while(s.charAt(i)=='b')
			i++;
		int traila=0,trailb=0;
		while(i<n)
		{
			while(i<n && s.charAt(i)=='a')
			{
				i++;
				traila++;
			}
			while(i<n && s.charAt(i)=='b')
			{
				i++;
				trailb++;
			}
			if(trailb!=0)
				ans=(ans+trailb+2*trailb*(pow(2,traila-1)-1))%mod;
			traila=traila;
			trailb=0;
		}
		out.println(ans);
	}






	
	///////////////////////////////////////////////////////////
	static BufferedReader br;
	static StringTokenizer st;
	static PrintWriter out;
	static String nextToken()throws IOException
	{
		while(st==null || !st.hasMoreTokens())
			st=new StringTokenizer(br.readLine());
		return st.nextToken();
	}
	static String nextLine()throws IOException
	{
		return br.readLine();
	}
	static int nextInt()throws IOException
	{
		return Integer.parseInt(nextToken());
	}
	static long nextLong()throws IOException
	{
		return Long.parseLong(nextToken());
	}
	static double nextDouble()throws IOException
	{
		return Double.parseDouble(nextToken());
	}
	public static void main(String args[])throws IOException
	{
		br=new BufferedReader(new InputStreamReader(System.in));
		out=new PrintWriter(new BufferedOutputStream(System.out));
		solve();
		out.close();
	}
}