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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @author Don Li
 */
public class MinimumSteps {
    
    int N = (int) 1e6 + 5;
    int MOD = (int) 1e9 + 7;
    
    long[] p2 = new long[N];
    
    void solve() {
        char[] s = in.nextToken().toCharArray();
        int n = s.length;
        
        p2[0] = 1;
        for (int i = 1; i < N; i++) p2[i] = p2[i - 1] * 2 % MOD;
        
        int m = 0;
        Segment[] seg = new Segment[n];
        for (int i = 0; i < n; ) {
            int j = i + 1;
            while (j < n && s[j] == s[i]) j++;
            seg[m++] = new Segment(s[i], j - i);
            i = j;
        }
        
        long ans = 0;
        for (int p = seg[0].type == 'b' ? 1 : 0; p < m; p += 2) {
            int x = seg[p].len;
            if (p + 1 < m) {
                int y = seg[p + 1].len;
                ans = (ans + calc(x, y)) % MOD;
                if (p + 2 < m) seg[p + 2].len += x;
            }
        }
        out.println(ans);
    }
    
    int calc(int x, int y) {
        return (int) ((p2[x] - 1 + MOD) % MOD * y % MOD);
    }
    
    static class Segment {
        char type;
        int len;
        
        Segment(char type, int len) {
            this.type = type;
            this.len = len;
        }
    }
    
    public static void main(String[] args) {
        in = new FastScanner(new BufferedReader(new InputStreamReader(System.in)));
        out = new PrintWriter(System.out);
        new MinimumSteps().solve();
        out.close();
    }
    
    static FastScanner in;
    static PrintWriter out;
    
    static class FastScanner {
        BufferedReader in;
        StringTokenizer st;
        
        public FastScanner(BufferedReader in) {
            this.in = in;
        }
        
        public String nextToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(in.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        
        public int nextInt() {
            return Integer.parseInt(nextToken());
        }
        
        public long nextLong() {
            return Long.parseLong(nextToken());
        }
        
        public double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }
}
