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.StringTokenizer;

public class TaskD {
	static final int mod = 1000_000_007;
	
	public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException {
		char[] c = in.next().toCharArray();
		int i = c.length - 1;
		while (c[i]=='a') i--;

		long sum = 0L;
		int k = 0;
		int m = 0;
		while (i>=0) {
			while(i>=0 && c[i] == 'b') { k++; i--;}
			while(i>=0 && c[i] == 'a') { m++; i--;}
			int powResult = pow(2, m);
			int powRes = (int) ((powResult - 1) * (long) k % mod);
			sum += powRes;
			sum %= mod;
			// out.println(m +" "+k + " " + sum);
			// out.flush();
			k = (int) (powResult * (long) k % mod);
			m = 0;
		}

		out.println(sum);
	}

	public int pow(int a, int b) {
		if (b==0) return 1;
		int res = pow(a, b/2);
		int f = (int) (res * (long) res % mod);
		if ((b&1) == 1)
			f = (int) (f * (long) a % mod);

		return f;
	}

	public static void main(String[] args) throws IOException {
        try (InputReader reader = new InputReader(System.in);
             PrintWriter writer = new PrintWriter(System.out)) {
            new TaskD().solve(1, reader, writer);
            writer.flush();
        }
    }

    static class InputReader extends BufferedReader {
        StringTokenizer tokenizer;

        public InputReader(InputStream inputStream) {
            super(new InputStreamReader(inputStream), 32768);
        }

        public InputReader(String filename) {
            super(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(filename)));
        }

        public String next() throws IOException {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                String line = readLine();
                if (line == null)
                    return null;
                tokenizer = new StringTokenizer(line);
            }
            return tokenizer.nextToken();
        }

        public Integer nextInt() throws IOException {
            return Integer.valueOf(next());
        }

        public Long nextLong() throws IOException {
            return Long.valueOf(next());
        }

        public int[] readIntArray (int size) throws IOException {
            int[] array = new int[size];
            for (int i = 0; i < size; i++)
                array[i] = nextInt();
            return array;
        }
    }

    static class FastWriter extends PrintWriter {
        public FastWriter(OutputStream outputStream) {
            super(outputStream);
        }
    }
}