L = input()

MOD = 10**9 + 7

# i: 決定した桁数
# j: a+b < L[i]を満たすか
dp = [[0] * 2 for _ in range(len(L) + 1)]

dp[0][0] = 1

for i in range(len(L)):
    for j in range(2):
        # (a,b) = (0,0)
        if int(L[i]):
            dp[i+1][1] += dp[i][j]
            dp[i+1][1] %= MOD
        else:
            dp[i+1][j] += dp[i][j]
            dp[i+1][j] %= MOD

        # (a,b) = (0,1), (1,0)
        if int(L[i]) or j:
            dp[i+1][j] += dp[i][j] * 2
            dp[i+1][j] %= MOD

print((dp[-1][0] + dp[-1][1]) % MOD) L = input() L input() input MOD = 10**9 + 7 MOD 10**9 + 7 10**9 10 9 7 [0] * 2 for _ in range(len(L) + 1) for _ in range(len(L) + 1) _ range(len(L) + 1) range len(L) + 1 len(L) len L 1 for _ in range(len(L) + 1) [0] * 2 [0] 0 2 dp = [[0] * 2 for _ in range(len(L) + 1)] dp [[0] * 2 for _ in range(len(L) + 1)] dp[0][0] = 1 dp[0][0] [0] dp 0 0 1 for i in range(len(L)):
    for j in range(2):
        # (a,b) = (0,0)
        if int(L[i]):
            dp[i+1][1] += dp[i][j]
            dp[i+1][1] %= MOD
        else:
            dp[i+1][j] += dp[i][j]
            dp[i+1][j] %= MOD

        # (a,b) = (0,1), (1,0)
        if int(L[i]) or j:
            dp[i+1][j] += dp[i][j] * 2
            dp[i+1][j] %= MOD i range(len(L)) range len(L) len L for j in range(2):
        # (a,b) = (0,0)
        if int(L[i]):
            dp[i+1][1] += dp[i][j]
            dp[i+1][1] %= MOD
        else:
            dp[i+1][j] += dp[i][j]
            dp[i+1][j] %= MOD

        # (a,b) = (0,1), (1,0)
        if int(L[i]) or j:
            dp[i+1][j] += dp[i][j] * 2
            dp[i+1][j] %= MOD j range(2) range 2 if int(L[i]):
            dp[i+1][1] += dp[i][j]
            dp[i+1][1] %= MOD
        else:
            dp[i+1][j] += dp[i][j]
            dp[i+1][j] %= MOD

        # (a,b) = (0,1), (1,0)
         int(L[i]) int L[i] L i dp[i+1][1] += dp[i][j] dp[i+1][1] [i+1] dp i+1 i 1 1 dp[i][j] [i] dp i j dp[i+1][1] %= MOD dp[i+1][1] [i+1] dp i+1 i 1 1 MOD dp[i+1][j] += dp[i][j] dp[i+1][j] [i+1] dp i+1 i 1 j dp[i][j] [i] dp i j dp[i+1][j] %= MOD dp[i+1][j] [i+1] dp i+1 i 1 j MOD if int(L[i]) or j:
            dp[i+1][j] += dp[i][j] * 2
            dp[i+1][j] %= MOD int(L[i]) or j int(L[i]) int L[i] L i j dp[i+1][j] += dp[i][j] * 2 dp[i+1][j] [i+1] dp i+1 i 1 j dp[i][j] * 2 dp[i][j] [i] dp i j 2 dp[i+1][j] %= MOD dp[i+1][j] [i+1] dp i+1 i 1 j MOD print((dp[-1][0] + dp[-1][1]) % MOD) print (dp[-1][0] + dp[-1][1]) % MOD dp[-1][0] + dp[-1][1] dp[-1][0] [-1] dp -1 0 dp[-1][1] [-1] dp -1 1 MOD dp = [[0] * 2 for _ in range(len(L) + 1)] [[0] * 2 for _ in range(len(L) + 1)] dp MOD = 10**9 + 7 10**9 + 7 MOD L = input() input() L
L = input()

MOD = 10**9 + 7

# i: 決定した桁数
# j: a+b < L[i]を満たすか
dp = [[0] * 2 for _ in range(len(L) + 1)]

dp[0][0] = 1

for i in range(len(L)):
    for j in range(2):
        # (a,b) = (0,0)
        if int(L[i]):
            dp[i+1][1] += dp[i][j]
            dp[i+1][1] %= MOD
        else:
            dp[i+1][j] += dp[i][j]
            dp[i+1][j] %= MOD

        # (a,b) = (0,1), (1,0)
        if int(L[i]) or j:
            dp[i+1][j] += dp[i][j] * 2
            dp[i+1][j] %= MOD

print((dp[-1][0] + dp[-1][1]) % MOD)