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 10<sup class="upper-index">9</sup> + 7.

The string "ab" appears as a substring if there is a letter 'b' right after the letter 'a' somewhere in the string.
The first line contains the initial string consisting of letters 'a' and 'b' only with length from 1 to 10<sup class="upper-index">6</sup>.
The first example: "ab"  →  "bba".

The second example: "aab"  →  "abba"  →  "bbaba"  →  "bbbbaa".
ab
1
aab
3
aaaaabaabababaaaaaba
17307
abaabaaabbabaabab
1795
abbaa
2
abbaaabaabaaaaabbbbaababaaaaabaabbaaaaabbaabbaaaabbbabbbabb
690283580
aababbaaaabbaabbbbbbbbabbababbbaaabbaaabbabbba
2183418
aabbaababbabbbaabbaababaaaabbaaaabaaaaaababbaaaabaababbabbbb
436420225
aaabaaaabbababbaabbababbbbaaaaaaabbabbba
8431094
abbbbababbabbbbbabaabbbaabbbbbbbaaab
8180
bbababbbaabaaaaaaaabbabbbb
40979
abbbaaabbbbbabaabbaaabbbababbbaabaabababababa
2065758
abaaaaaabaaaabbabbaaabbbbabababaaaaabbaabbaaaaabbbaababaaaaaaabbbbbaaaaabaababbabababbabbbbaabbaabbabbbabaabbaabbaaaaaab
235606597
abbbbbbbbbbbbbbbbbbbbbbbbbbaababaaaaaaabaabaaababaabaababaaabababaababab
7
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbaaaaaaaaabaabaaababaabaababaaabababaabbbbbbb
557763786
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import math
a=input()
mod=int(1e9+7)
ans=int(0)
sum=0
def pow(c):
    ans=1
    c=int(c)
    base=2
    while c:
        if c%2==1:
            ans=(ans*base)%mod
        base=(base*base)%mod
        c/=2
    return ans
for s in(a):
    if s=='b':
        if sum>=1:
            temp=int(pow(sum))
            ans+=(temp-1)
            ans%=mod
    else:
        sum+=1
print(ans)



