l = list(map(int, input()))
mod = 10 ** 9 + 7

ln = len(l)
dp = [[0] * 2 for _ in range(2)]
dp[0][1] = 1

for e in l:
    dp_new = [[0] * 2 for _ in range(2)]
    for i in range(2):
        # same -> same
        if i == e:
            dp_new[i][1] += (dp[0][1] + dp[1][1]) * (1 + i)

        # same -> small
        if i == 0 and e == 1:
            dp_new[0][0] += dp[0][1] + dp[1][1]

        # small -> small
        dp_new[i][0] += (dp[0][0] + dp[1][0]) * (1 + i)

    dp = dp_new
    for i in range(2):
        for j in range(2):
            dp[i][j] %= mod

ans = 0
for row in dp:
    ans += sum(row)
    ans %= mod

print(ans) l = list(map(int, input())) l list(map(int, input())) list map(int, input()) map int input() input mod = 10 ** 9 + 7 mod 10 ** 9 + 7 10 ** 9 10 9 7 ln = len(l) ln len(l) len l [0] * 2 for _ in range(2) for _ in range(2) _ range(2) range 2 for _ in range(2) [0] * 2 [0] 0 2 dp = [[0] * 2 for _ in range(2)] dp [[0] * 2 for _ in range(2)] dp[0][1] = 1 dp[0][1] [0] dp 0 1 1 for e in l:
    dp_new = [[0] * 2 for _ in range(2)]
    for i in range(2):
        # same -> same
        if i == e:
            dp_new[i][1] += (dp[0][1] + dp[1][1]) * (1 + i)

        # same -> small
        if i == 0 and e == 1:
            dp_new[0][0] += dp[0][1] + dp[1][1]

        # small -> small
        dp_new[i][0] += (dp[0][0] + dp[1][0]) * (1 + i)

    dp = dp_new
    for i in range(2):
        for j in range(2):
            dp[i][j] %= mod e l [0] * 2 for _ in range(2) for _ in range(2) _ range(2) range 2 for _ in range(2) [0] * 2 [0] 0 2 dp_new = [[0] * 2 for _ in range(2)] dp_new [[0] * 2 for _ in range(2)] for i in range(2):
        # same -> same
        if i == e:
            dp_new[i][1] += (dp[0][1] + dp[1][1]) * (1 + i)

        # same -> small
        if i == 0 and e == 1:
            dp_new[0][0] += dp[0][1] + dp[1][1]

        # small -> small
        dp_new[i][0] += (dp[0][0] + dp[1][0]) * (1 + i)

     i range(2) range 2 if i == e:
            dp_new[i][1] += (dp[0][1] + dp[1][1]) * (1 + i)

        # same -> small
         i == e i e dp_new[i][1] += (dp[0][1] + dp[1][1]) * (1 + i) dp_new[i][1] [i] dp_new i 1 (dp[0][1] + dp[1][1]) * (1 + i) dp[0][1] + dp[1][1] dp[0][1] [0] dp 0 1 dp[1][1] [1] dp 1 1 1 + i 1 i if i == 0 and e == 1:
            dp_new[0][0] += dp[0][1] + dp[1][1]

        # small -> small
         i == 0 and e == 1 i == 0 i 0 e == 1 e 1 dp_new[0][0] += dp[0][1] + dp[1][1] dp_new[0][0] [0] dp_new 0 0 dp[0][1] + dp[1][1] dp[0][1] [0] dp 0 1 dp[1][1] [1] dp 1 1 dp_new[i][0] += (dp[0][0] + dp[1][0]) * (1 + i) dp_new[i][0] [i] dp_new i 0 (dp[0][0] + dp[1][0]) * (1 + i) dp[0][0] + dp[1][0] dp[0][0] [0] dp 0 0 dp[1][0] [1] dp 1 0 1 + i 1 i dp = dp_new dp dp_new for i in range(2):
        for j in range(2):
            dp[i][j] %= mod i range(2) range 2 for j in range(2):
            dp[i][j] %= mod j range(2) range 2 dp[i][j] %= mod dp[i][j] [i] dp i j mod ans = 0 ans 0 for row in dp:
    ans += sum(row)
    ans %= mod row dp ans += sum(row) ans sum(row) sum row ans %= mod ans mod print(ans) print ans dp = dp_new dp_new dp l = list(map(int, input())) list(map(int, input())) l ans += sum(row) sum(row) ans dp_new = [[0] * 2 for _ in range(2)] [[0] * 2 for _ in range(2)] dp_new ans %= mod mod ans ln = len(l) len(l) ln dp = [[0] * 2 for _ in range(2)] [[0] * 2 for _ in range(2)] dp ans = 0 0 ans mod = 10 ** 9 + 7 10 ** 9 + 7 mod
l = list(map(int, input()))
mod = 10 ** 9 + 7

ln = len(l)
dp = [[0] * 2 for _ in range(2)]
dp[0][1] = 1

for e in l:
    dp_new = [[0] * 2 for _ in range(2)]
    for i in range(2):
        # same -> same
        if i == e:
            dp_new[i][1] += (dp[0][1] + dp[1][1]) * (1 + i)

        # same -> small
        if i == 0 and e == 1:
            dp_new[0][0] += dp[0][1] + dp[1][1]

        # small -> small
        dp_new[i][0] += (dp[0][0] + dp[1][0]) * (1 + i)

    dp = dp_new
    for i in range(2):
        for j in range(2):
            dp[i][j] %= mod

ans = 0
for row in dp:
    ans += sum(row)
    ans %= mod

print(ans)
