L = input()
N = len(L)
mod = 10 ** 9 + 7
dp = [[0] * 2 for _ in range(100005)]
dp[0][0] = 1
for i in range(N):
    # a + b = 0
    if L[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

    # a + b = 1
    if L[i] == "0":
        dp[i + 1][1] += dp[i][1] * 2 % mod
        dp[i + 1][1] %= mod
    else:
        dp[i + 1][0] += dp[i][0] * 2 % mod
        dp[i + 1][0] %= mod
        dp[i + 1][1] += dp[i][1] * 2 % mod
        dp[i + 1][1] %= mod

ans = dp[N][0] + dp[N][1]
print(ans % mod) L = input() L input() input N = len(L) N len(L) len L mod = 10 ** 9 + 7 mod 10 ** 9 + 7 10 ** 9 10 9 7 [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 for i in range(N):
    # a + b = 0
    if L[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

    # a + b = 1
    if L[i] == "0":
        dp[i + 1][1] += dp[i][1] * 2 % mod
        dp[i + 1][1] %= mod
    else:
        dp[i + 1][0] += dp[i][0] * 2 % mod
        dp[i + 1][0] %= mod
        dp[i + 1][1] += dp[i][1] * 2 % mod
        dp[i + 1][1] %= mod i range(N) range N if L[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

    # a + b = 1
     L[i] == "0" L[i] L 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 L[i] == "0":
        dp[i + 1][1] += dp[i][1] * 2 % mod
        dp[i + 1][1] %= mod
    else:
        dp[i + 1][0] += dp[i][0] * 2 % mod
        dp[i + 1][0] %= mod
        dp[i + 1][1] += dp[i][1] * 2 % mod
        dp[i + 1][1] %= mod L[i] == "0" L[i] L 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][1] %= mod dp[i + 1][1] [i + 1] dp i + 1 i 1 1 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][0] %= mod dp[i + 1][0] [i + 1] dp i + 1 i 1 0 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 dp[i + 1][1] %= mod dp[i + 1][1] [i + 1] dp i + 1 i 1 1 mod ans = dp[N][0] + dp[N][1] ans dp[N][0] + dp[N][1] dp[N][0] [N] dp N 0 dp[N][1] [N] dp N 1 print(ans % mod) print ans % mod ans mod L = input() input() L dp = [[0] * 2 for _ in range(100005)] [[0] * 2 for _ in range(100005)] dp ans = dp[N][0] + dp[N][1] dp[N][0] + dp[N][1] ans mod = 10 ** 9 + 7 10 ** 9 + 7 mod N = len(L) len(L) N
L = input()
N = len(L)
mod = 10 ** 9 + 7
dp = [[0] * 2 for _ in range(100005)]
dp[0][0] = 1
for i in range(N):
    # a + b = 0
    if L[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

    # a + b = 1
    if L[i] == "0":
        dp[i + 1][1] += dp[i][1] * 2 % mod
        dp[i + 1][1] %= mod
    else:
        dp[i + 1][0] += dp[i][0] * 2 % mod
        dp[i + 1][0] %= mod
        dp[i + 1][1] += dp[i][1] * 2 % mod
        dp[i + 1][1] %= mod

ans = dp[N][0] + dp[N][1]
print(ans % mod)