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.math.BigInteger;
import java.util.*;

public class Main {
    private final static long mod = 1000000007;

    private static void printArr2(long arr[][]) {

        int i, j, n = arr.length, m = arr[0].length;
        for (i = 0; i < n; i++) {
            for (j = 0; j < m; j++) {
                System.out.print(arr[i][j] + " ");
            }
            System.out.println();
        }
    }

    private static void printArr(int arr[][]) {
        int i, j, n = arr.length, m = arr[0].length;
        for (i = 0; i < n; i++) {
            for (j = 0; j < m; j++) {
                System.out.print(arr[i][j] + " ");
            }
            System.out.println();
        }
    }


    private static long power(long x, long y, long m) {
        long temp;
        if (y == 0)
            return 1;
        temp = power(x, y / 2,m);
        temp = (temp * temp) % m;
        if (y % 2 == 0)
            return temp;
        else
            return ((x % m) * temp) % m;
    }

    private static  long power(long x, long y){
        return power(x,y,mod);
    }

    private static int gcd(int a, int b) {
        if (b == 0) return a;
        return gcd(b, a % b);
    }

    private static int cmp(Pair p, Pair q) {
        return p.sz == q.sz ? p.mt - q.mt : p.sz - q.sz;
    }

    static int nextPowerOf2(int n) {
        int count = 0;
        if (n > 0 && (n & (n - 1)) == 0)
            return n * 2;

        while (n != 0) {
            n >>= 1;
            count += 1;
        }

        return 1 << count;
    }
    static String isPrime(int n){
        int i;
        for(i=2;i*i<n;i++){
            if(n%i==0)return "Not prime";
        }
        return "Prime";
    }

    private static long[] computeTotient(int n) {
        long phi[] = new long[n + 1];
        for (int i = 1; i <= n; i++)
            phi[i] = i;
        for (int p = 2; p <= n; p++) {
            if (phi[p] == p) {
                phi[p] = p - 1;
                for (int i = 2 * p; i <= n; i += p) {
                    phi[i] = (phi[i] / p) * (p - 1);
                }
            }
        }
        return phi;
    }

    private static long modInverse(long a, long m) {
        long m0 = m;
        long y = 0, x = 1;
        if (m == 1)
            return 0;
        while (a > 1) {
            long q = a / m;
            long t = m;
            m = a % m;
            a = t;
            t = y;
            y = x - q * y;
            x = t;
        }
        if (x < 0)
            x += m0;
        return x;
    }

    private static boolean isPossible(int a[],int b[],long k,long m){
        long r=0;
        for(int i=0;i<a.length;i++){
            if(m*a[i]-b[i]>0)
                r-=b[i]-m*a[i];
        }
        return k>=r;
    }

    public static void main(String[] args) throws IOException {
        FastReader in = new FastReader();
        FastWriter out = new FastWriter();
        int t, i, j, k, r, l = 0,g, m = 0, x, d,n,ti;
        long ans = 0, sum=0, cur=0, w, mx = -mod, mn = mod,y,md;
        //tc:for (t = in.nextInt(),ti=1; ti <= t; ti++)
        {
            //out.print(String.format("Case #%d: ", ti));
            String s=in.next();
            for(i=s.length()-1;i>=0;i--){
                if(s.charAt(i)=='b')cur++;else{
                    ans+=cur;cur*=2;ans%=mod;cur%=mod;
                }
            }
            out.println(ans);
        }
    }

    private static class Pair {
        int sz;
        int mt;

        public Pair(int sz, int mt) {
            this.sz = sz;
            this.mt = mt;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Pair pair = (Pair) o;
            return sz == pair.sz &&
                    mt == pair.mt;
        }

        @Override
        public int hashCode() {

            return Objects.hash(sz, mt);
        }
    }

    static class FastReader {
        private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        private StringTokenizer st;

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        int[] nextIntArr(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

        long[] nextLongArr(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

    }

    static class FastWriter {
        BufferedWriter bw;
        List<String> list = new ArrayList<>();
        Set<String> set = new HashSet<>();

        FastWriter() {
            bw = new BufferedWriter(new OutputStreamWriter(System.out));
        }

        <T> void print(T obj) throws IOException {
            bw.write(obj.toString());
            bw.flush();
        }

        void println() throws IOException {
            print("\n");
        }

        <T> void println(T obj) throws IOException {
            print(obj.toString() + "\n");
        }

        <T> void printArrLn(T[] arr) throws IOException {
            for (int i = 0; i < arr.length-1; i++) {
                print(arr[i] + " ");
            }
            println(arr[arr.length-1]);
        }
        <T> void printColl(Collection<T> coll) throws IOException {
            for (T e:coll) {
                print(e + " ");
            }
            println();
        }

        void printCharN(char c, int n) throws IOException {
            for (int i = 0; i < n; i++) {
                print(c);
            }
        }
    }


}