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.*;
import java.math.*;
import java.text.*;
public class Prac{     
    static class InputReader { 
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        public InputReader(InputStream st) {
            this.stream = st;
        } 
        public int read() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } 
                catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }
        public int ni() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        } 
        public long nl() {
            int c = read();
            while (isSpaceChar(c)) {
            c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        } 
        public int[] nia(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = ni();
            }
            return a;
        } 
        public String rs() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                    c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }
        public String nextLine() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        } 
        public boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
 
        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        } 
    }
    public static class Key {

        private final int x;
        private final int y;

        public Key(int x, int y) {
            this.x = x;
            this.y = y;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (!(o instanceof Key)) return false;
            Key key = (Key) o;
            return x == key.x && y == key.y;
        }

        @Override
        public int hashCode() {
            int result = x;
            result = 31 * result + y;
            return result;
        }

    }
    
    static PrintWriter w = new PrintWriter(System.out);
    static long mod=998244353L,mod1=1000000007;
    static int co[][];
    static void dsort(){
        Arrays.parallelSort(co,(o1,o2)->o1[0]!=o2[0]?o1[0]-o2[0]:o1[1]-o2[1]);
    }
     static long  power(long x, long y) { 
        long temp=0; 
        if( y == 0) 
            return 1; 
        temp = power(x, y/2); 
        if (y%2 == 0) 
            return (temp*temp)%mod1; 
        else
            return (((x*temp)%mod1)*temp)%mod1; 
    } 
    static long modInverse(long a, long m){
        long num=m;
        long x=1;
        long power=a%mod1;
        while(num>0){
              if(num%2==1){
                  x=(x*power)%mod1;
            }
            num>>=1;
            power=(power*power)%mod1;         
        }
        return x;
    }
    static long ncr(int n,int r){
        if(n<r)return 0L;
        long ans=fact[n]/(fact[r]*fact[n-r]);
        return ans;
    }
    static long fact[]=new long[1000005];
    public static void findFact(){
        fact[0]=1;
        for(int i=1;i<=1000000;i++){
            fact[i]=(i*fact[i-1])%mod1;
        }
    } 
    static long nCr(int n,int r){
        if(n<r)return 0L;
        
        return (fact[n]*modInverse((fact[r]*fact[n-r])%mod1,mod1-2))%mod1;
    }
    public static void main (String[] args)throws IOException{
        InputReader sc=new InputReader(System.in);
        findFact();
        
        char arr[]=sc.nextLine().toCharArray();
        int c=0,n=arr.length;
        long ans=0;
        for(int i=n-1;i>=0;i--){
            if(arr[i]=='a'){
                ans+=c;
                c=c*2;
                c%=mod1;
                ans%=mod1;
            }
            else c++;
        }
        w.println(ans);
        w.close();
    }
}