def main():
    L = input().rstrip()
    MOD = 10**9 + 7
    dp = [[0 for equal in range(2)] for digit in range(len(L) + 1)]
    dp[0][0] = 1
    for digit in range(len(L)):
        x = int(L[digit])
        if x == 1:
            dp[digit+1][1] += dp[digit][0] + dp[digit][1]
            dp[digit+1][0] += dp[digit][0] * 2
            dp[digit+1][1] += dp[digit][1] * 2
        else:
            dp[digit+1][0] += dp[digit][0]
            dp[digit+1][1] += dp[digit][1]
            dp[digit+1][1] += dp[digit][1] * 2
        dp[digit+1][0] %= MOD
        dp[digit+1][1] %= MOD
    print((dp[len(L)][0] + dp[len(L)][1])%MOD)

if __name__ == "__main__":
    main() def main():
    L = input().rstrip()
    MOD = 10**9 + 7
    dp = [[0 for equal in range(2)] for digit in range(len(L) + 1)]
    dp[0][0] = 1
    for digit in range(len(L)):
        x = int(L[digit])
        if x == 1:
            dp[digit+1][1] += dp[digit][0] + dp[digit][1]
            dp[digit+1][0] += dp[digit][0] * 2
            dp[digit+1][1] += dp[digit][1] * 2
        else:
            dp[digit+1][0] += dp[digit][0]
            dp[digit+1][1] += dp[digit][1]
            dp[digit+1][1] += dp[digit][1] * 2
        dp[digit+1][0] %= MOD
        dp[digit+1][1] %= MOD
    print((dp[len(L)][0] + dp[len(L)][1])%MOD) main L = input().rstrip() L input().rstrip() ().rstrip () input rstrip MOD = 10**9 + 7 MOD 10**9 + 7 10**9 10 9 7 [0 for equal in range(2)] for digit in range(len(L) + 1) for digit in range(len(L) + 1) digit range(len(L) + 1) range len(L) + 1 len(L) len L 1 for digit in range(len(L) + 1) [0 for equal in range(2)] dp = [[0 for equal in range(2)] for digit in range(len(L) + 1)] dp [[0 for equal in range(2)] for digit in range(len(L) + 1)] dp[0][0] = 1 dp[0][0] [0] dp 0 0 1 for digit in range(len(L)):
        x = int(L[digit])
        if x == 1:
            dp[digit+1][1] += dp[digit][0] + dp[digit][1]
            dp[digit+1][0] += dp[digit][0] * 2
            dp[digit+1][1] += dp[digit][1] * 2
        else:
            dp[digit+1][0] += dp[digit][0]
            dp[digit+1][1] += dp[digit][1]
            dp[digit+1][1] += dp[digit][1] * 2
        dp[digit+1][0] %= MOD
        dp[digit+1][1] %= MOD
     digit range(len(L)) range len(L) len L x = int(L[digit]) x int(L[digit]) int L[digit] L digit if x == 1:
            dp[digit+1][1] += dp[digit][0] + dp[digit][1]
            dp[digit+1][0] += dp[digit][0] * 2
            dp[digit+1][1] += dp[digit][1] * 2
        else:
            dp[digit+1][0] += dp[digit][0]
            dp[digit+1][1] += dp[digit][1]
            dp[digit+1][1] += dp[digit][1] * 2
         x == 1 x 1 dp[digit+1][1] += dp[digit][0] + dp[digit][1] dp[digit+1][1] [digit+1] dp digit+1 digit 1 1 dp[digit][0] + dp[digit][1] dp[digit][0] [digit] dp digit 0 dp[digit][1] [digit] dp digit 1 dp[digit+1][0] += dp[digit][0] * 2 dp[digit+1][0] [digit+1] dp digit+1 digit 1 0 dp[digit][0] * 2 dp[digit][0] [digit] dp digit 0 2 dp[digit+1][1] += dp[digit][1] * 2 dp[digit+1][1] [digit+1] dp digit+1 digit 1 1 dp[digit][1] * 2 dp[digit][1] [digit] dp digit 1 2 dp[digit+1][0] += dp[digit][0] dp[digit+1][0] [digit+1] dp digit+1 digit 1 0 dp[digit][0] [digit] dp digit 0 dp[digit+1][1] += dp[digit][1] dp[digit+1][1] [digit+1] dp digit+1 digit 1 1 dp[digit][1] [digit] dp digit 1 dp[digit+1][1] += dp[digit][1] * 2 dp[digit+1][1] [digit+1] dp digit+1 digit 1 1 dp[digit][1] * 2 dp[digit][1] [digit] dp digit 1 2 dp[digit+1][0] %= MOD dp[digit+1][0] [digit+1] dp digit+1 digit 1 0 MOD dp[digit+1][1] %= MOD dp[digit+1][1] [digit+1] dp digit+1 digit 1 1 MOD print((dp[len(L)][0] + dp[len(L)][1])%MOD) print (dp[len(L)][0] + dp[len(L)][1])%MOD dp[len(L)][0] + dp[len(L)][1] dp[len(L)][0] [len(L)] dp len(L) len L 0 dp[len(L)][1] [len(L)] dp len(L) len L 1 MOD if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    L = input().rstrip()
    MOD = 10**9 + 7
    dp = [[0 for equal in range(2)] for digit in range(len(L) + 1)]
    dp[0][0] = 1
    for digit in range(len(L)):
        x = int(L[digit])
        if x == 1:
            dp[digit+1][1] += dp[digit][0] + dp[digit][1]
            dp[digit+1][0] += dp[digit][0] * 2
            dp[digit+1][1] += dp[digit][1] * 2
        else:
            dp[digit+1][0] += dp[digit][0]
            dp[digit+1][1] += dp[digit][1]
            dp[digit+1][1] += dp[digit][1] * 2
        dp[digit+1][0] %= MOD
        dp[digit+1][1] %= MOD
    print((dp[len(L)][0] + dp[len(L)][1])%MOD) def main():
    L = input().rstrip()
    MOD = 10**9 + 7
    dp = [[0 for equal in range(2)] for digit in range(len(L) + 1)]
    dp[0][0] = 1
    for digit in range(len(L)):
        x = int(L[digit])
        if x == 1:
            dp[digit+1][1] += dp[digit][0] + dp[digit][1]
            dp[digit+1][0] += dp[digit][0] * 2
            dp[digit+1][1] += dp[digit][1] * 2
        else:
            dp[digit+1][0] += dp[digit][0]
            dp[digit+1][1] += dp[digit][1]
            dp[digit+1][1] += dp[digit][1] * 2
        dp[digit+1][0] %= MOD
        dp[digit+1][1] %= MOD
    print((dp[len(L)][0] + dp[len(L)][1])%MOD) main
def main():
    L = input().rstrip()
    MOD = 10**9 + 7
    dp = [[0 for equal in range(2)] for digit in range(len(L) + 1)]
    dp[0][0] = 1
    for digit in range(len(L)):
        x = int(L[digit])
        if x == 1:
            dp[digit+1][1] += dp[digit][0] + dp[digit][1]
            dp[digit+1][0] += dp[digit][0] * 2
            dp[digit+1][1] += dp[digit][1] * 2
        else:
            dp[digit+1][0] += dp[digit][0]
            dp[digit+1][1] += dp[digit][1]
            dp[digit+1][1] += dp[digit][1] * 2
        dp[digit+1][0] %= MOD
        dp[digit+1][1] %= MOD
    print((dp[len(L)][0] + dp[len(L)][1])%MOD)

if __name__ == "__main__":
    main()