import sys

sys.setrecursionlimit(10 ** 7)
# ----------

INF = float("inf")
MOD = 10 ** 9 + 7

s = input().strip()

dp = [[0] * 2 for _ in range(100005)]
dp[0][0] = 1

n = len(s)
for i in range(n):
    if s[i] == "0":
        dp[i + 1][0] = dp[i][0]
        dp[i + 1][1] = dp[i][1]
    else:
        dp[i + 1][1] = (dp[i][0] + dp[i][1]) % MOD

    if s[i] == "0":
        dp[i + 1][1] += dp[i][1] * 2 % MOD
    else:
        dp[i + 1][0] += dp[i][0] * 2 % MOD
        dp[i + 1][1] += dp[i][1] * 2 % MOD

ans = (dp[n][0] + dp[n][1]) % MOD
print(ans) import sys sys sys.setrecursionlimit(10 ** 7) sys.setrecursionlimit sys setrecursionlimit 10 ** 7 10 7 INF = float("inf") INF float("inf") float "inf" MOD = 10 ** 9 + 7 MOD 10 ** 9 + 7 10 ** 9 10 9 7 s = input().strip() s input().strip() ().strip () input strip [0] * 2 for _ in range(100005) for _ in range(100005) _ range(100005) range 100005 for _ in range(100005) [0] * 2 [0] 0 2 dp = [[0] * 2 for _ in range(100005)] dp [[0] * 2 for _ in range(100005)] dp[0][0] = 1 dp[0][0] [0] dp 0 0 1 n = len(s) n len(s) len s for i in range(n):
    if s[i] == "0":
        dp[i + 1][0] = dp[i][0]
        dp[i + 1][1] = dp[i][1]
    else:
        dp[i + 1][1] = (dp[i][0] + dp[i][1]) % MOD

    if s[i] == "0":
        dp[i + 1][1] += dp[i][1] * 2 % MOD
    else:
        dp[i + 1][0] += dp[i][0] * 2 % MOD
        dp[i + 1][1] += dp[i][1] * 2 % MOD i range(n) range n if s[i] == "0":
        dp[i + 1][0] = dp[i][0]
        dp[i + 1][1] = dp[i][1]
    else:
        dp[i + 1][1] = (dp[i][0] + dp[i][1]) % MOD

     s[i] == "0" s[i] s i "0" dp[i + 1][0] = dp[i][0] dp[i + 1][0] [i + 1] dp i + 1 i 1 0 dp[i][0] [i] dp i 0 dp[i + 1][1] = dp[i][1] dp[i + 1][1] [i + 1] dp i + 1 i 1 1 dp[i][1] [i] dp i 1 dp[i + 1][1] = (dp[i][0] + dp[i][1]) % MOD dp[i + 1][1] [i + 1] dp i + 1 i 1 1 (dp[i][0] + dp[i][1]) % MOD dp[i][0] + dp[i][1] dp[i][0] [i] dp i 0 dp[i][1] [i] dp i 1 MOD if s[i] == "0":
        dp[i + 1][1] += dp[i][1] * 2 % MOD
    else:
        dp[i + 1][0] += dp[i][0] * 2 % MOD
        dp[i + 1][1] += dp[i][1] * 2 % MOD s[i] == "0" s[i] s i "0" dp[i + 1][1] += dp[i][1] * 2 % MOD dp[i + 1][1] [i + 1] dp i + 1 i 1 1 dp[i][1] * 2 % MOD dp[i][1] * 2 dp[i][1] [i] dp i 1 2 MOD dp[i + 1][0] += dp[i][0] * 2 % MOD dp[i + 1][0] [i + 1] dp i + 1 i 1 0 dp[i][0] * 2 % MOD dp[i][0] * 2 dp[i][0] [i] dp i 0 2 MOD dp[i + 1][1] += dp[i][1] * 2 % MOD dp[i + 1][1] [i + 1] dp i + 1 i 1 1 dp[i][1] * 2 % MOD dp[i][1] * 2 dp[i][1] [i] dp i 1 2 MOD ans = (dp[n][0] + dp[n][1]) % MOD ans (dp[n][0] + dp[n][1]) % MOD dp[n][0] + dp[n][1] dp[n][0] [n] dp n 0 dp[n][1] [n] dp n 1 MOD print(ans) print ans dp = [[0] * 2 for _ in range(100005)] [[0] * 2 for _ in range(100005)] dp n = len(s) len(s) n s = input().strip() input().strip() s ans = (dp[n][0] + dp[n][1]) % MOD (dp[n][0] + dp[n][1]) % MOD ans INF = float("inf") float("inf") INF MOD = 10 ** 9 + 7 10 ** 9 + 7 MOD
import sys

sys.setrecursionlimit(10 ** 7)
# ----------

INF = float("inf")
MOD = 10 ** 9 + 7

s = input().strip()

dp = [[0] * 2 for _ in range(100005)]
dp[0][0] = 1

n = len(s)
for i in range(n):
    if s[i] == "0":
        dp[i + 1][0] = dp[i][0]
        dp[i + 1][1] = dp[i][1]
    else:
        dp[i + 1][1] = (dp[i][0] + dp[i][1]) % MOD

    if s[i] == "0":
        dp[i + 1][1] += dp[i][1] * 2 % MOD
    else:
        dp[i + 1][0] += dp[i][0] * 2 % MOD
        dp[i + 1][1] += dp[i][1] * 2 % MOD

ans = (dp[n][0] + dp[n][1]) % MOD
print(ans)
