L = input()
N = len(L)
MOD = 10 ** 9 + 7

# dp[i][j]: (a,b)の組の個数
# i: 決定した桁数
# j: a + b < L[i] フラグ
dp = [[0] * 2 for _ in range(N + 1)]

dp[0][0] = 1

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

print(sum(dp[N]) % 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(N + 1) for _ in range(N + 1) _ range(N + 1) range N + 1 N 1 for _ in range(N + 1) [0] * 2 [0] 0 2 dp = [[0] * 2 for _ in range(N + 1)] dp [[0] * 2 for _ in range(N + 1)] dp[0][0] = 1 dp[0][0] [0] dp 0 0 1 for i in range(N):
    for j in range(2):
        # (a, b) = (0, 0)
        if int(L[i]): # 1
            dp[i + 1][1] = (dp[i + 1][1] + dp[i][j]) % MOD
        else: # 0
            dp[i + 1][j] = (dp[i + 1][j] + dp[i][j]) % MOD
        
        # a ^ b = 1
        if int(L[i]) or j:
            dp[i+1][j] = (dp[i+1][j] + dp[i][j] * 2) % MOD i range(N) range N for j in range(2):
        # (a, b) = (0, 0)
        if int(L[i]): # 1
            dp[i + 1][1] = (dp[i + 1][1] + dp[i][j]) % MOD
        else: # 0
            dp[i + 1][j] = (dp[i + 1][j] + dp[i][j]) % MOD
        
        # a ^ b = 1
        if int(L[i]) or j:
            dp[i+1][j] = (dp[i+1][j] + dp[i][j] * 2) % MOD j range(2) range 2 if int(L[i]): # 1
            dp[i + 1][1] = (dp[i + 1][1] + dp[i][j]) % MOD
        else: # 0
            dp[i + 1][j] = (dp[i + 1][j] + dp[i][j]) % MOD
        
        # a ^ b = 1
         int(L[i]) int L[i] L i dp[i + 1][1] = (dp[i + 1][1] + dp[i][j]) % MOD dp[i + 1][1] [i + 1] dp i + 1 i 1 1 (dp[i + 1][1] + dp[i][j]) % MOD 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 MOD dp[i + 1][j] = (dp[i + 1][j] + dp[i][j]) % MOD dp[i + 1][j] [i + 1] dp i + 1 i 1 j (dp[i + 1][j] + dp[i][j]) % 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 MOD if int(L[i]) or j:
            dp[i+1][j] = (dp[i+1][j] + dp[i][j] * 2) % MOD int(L[i]) or j int(L[i]) int L[i] L i j dp[i+1][j] = (dp[i+1][j] + dp[i][j] * 2) % MOD dp[i+1][j] [i+1] dp i+1 i 1 j (dp[i+1][j] + dp[i][j] * 2) % MOD 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 MOD print(sum(dp[N]) % MOD) print sum(dp[N]) % MOD sum(dp[N]) sum dp[N] dp N MOD L = input() input() L dp = [[0] * 2 for _ in range(N + 1)] [[0] * 2 for _ in range(N + 1)] dp MOD = 10 ** 9 + 7 10 ** 9 + 7 MOD N = len(L) len(L) N
L = input()
N = len(L)
MOD = 10 ** 9 + 7

# dp[i][j]: (a,b)の組の個数
# i: 決定した桁数
# j: a + b < L[i] フラグ
dp = [[0] * 2 for _ in range(N + 1)]

dp[0][0] = 1

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

print(sum(dp[N]) % MOD)