L = input()
L_bi = L
keta = len(L)
mod = 1000000007

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

for i in range(len(L_bi)):
    for j in range(2):
        if j == 1:
            scale = 2
        else:
            scale = 1
        dp[i+1][0] = (dp[i+1][0] + scale*dp[i][0])%mod
        if int(L_bi[i]) > j:
            dp[i+1][0] = (dp[i+1][0] + scale*dp[i][1])%mod
        elif int(L_bi[i]) == j:
            dp[i+1][1] = (dp[i+1][1] + scale*dp[i][1])%mod
print((dp[len(L_bi)][0]+dp[len(L_bi)][1])%mod) L = input() L input() input L_bi = L L_bi L keta = len(L) keta len(L) len L mod = 1000000007 mod 1000000007 [0 for _ in range(2)] for _ in range(1000002) for _ in range(1000002) _ range(1000002) range 1000002 for _ in range(1000002) [0 for _ in range(2)] dp = [[0 for _ in range(2)] for _ in range(1000002)] dp [[0 for _ in range(2)] for _ in range(1000002)] dp[0][1]=1 dp[0][1] [0] dp 0 1 1 for i in range(len(L_bi)):
    for j in range(2):
        if j == 1:
            scale = 2
        else:
            scale = 1
        dp[i+1][0] = (dp[i+1][0] + scale*dp[i][0])%mod
        if int(L_bi[i]) > j:
            dp[i+1][0] = (dp[i+1][0] + scale*dp[i][1])%mod
        elif int(L_bi[i]) == j:
            dp[i+1][1] = (dp[i+1][1] + scale*dp[i][1])%mod i range(len(L_bi)) range len(L_bi) len L_bi for j in range(2):
        if j == 1:
            scale = 2
        else:
            scale = 1
        dp[i+1][0] = (dp[i+1][0] + scale*dp[i][0])%mod
        if int(L_bi[i]) > j:
            dp[i+1][0] = (dp[i+1][0] + scale*dp[i][1])%mod
        elif int(L_bi[i]) == j:
            dp[i+1][1] = (dp[i+1][1] + scale*dp[i][1])%mod j range(2) range 2 if j == 1:
            scale = 2
        else:
            scale = 1
         j == 1 j 1 scale = 2 scale 2 scale = 1 scale 1 dp[i+1][0] = (dp[i+1][0] + scale*dp[i][0])%mod dp[i+1][0] [i+1] dp i+1 i 1 0 (dp[i+1][0] + scale*dp[i][0])%mod dp[i+1][0] + scale*dp[i][0] dp[i+1][0] [i+1] dp i+1 i 1 0 scale*dp[i][0] scale dp[i][0] [i] dp i 0 mod if int(L_bi[i]) > j:
            dp[i+1][0] = (dp[i+1][0] + scale*dp[i][1])%mod
        elif int(L_bi[i]) == j:
            dp[i+1][1] = (dp[i+1][1] + scale*dp[i][1])%mod int(L_bi[i]) > j int(L_bi[i]) int L_bi[i] L_bi i j dp[i+1][0] = (dp[i+1][0] + scale*dp[i][1])%mod dp[i+1][0] [i+1] dp i+1 i 1 0 (dp[i+1][0] + scale*dp[i][1])%mod dp[i+1][0] + scale*dp[i][1] dp[i+1][0] [i+1] dp i+1 i 1 0 scale*dp[i][1] scale dp[i][1] [i] dp i 1 mod elif int(L_bi[i]) == j:
            dp[i+1][1] = (dp[i+1][1] + scale*dp[i][1])%mod int(L_bi[i]) == j int(L_bi[i]) int L_bi[i] L_bi i j dp[i+1][1] = (dp[i+1][1] + scale*dp[i][1])%mod dp[i+1][1] [i+1] dp i+1 i 1 1 (dp[i+1][1] + scale*dp[i][1])%mod dp[i+1][1] + scale*dp[i][1] dp[i+1][1] [i+1] dp i+1 i 1 1 scale*dp[i][1] scale dp[i][1] [i] dp i 1 mod print((dp[len(L_bi)][0]+dp[len(L_bi)][1])%mod) print (dp[len(L_bi)][0]+dp[len(L_bi)][1])%mod dp[len(L_bi)][0]+dp[len(L_bi)][1] dp[len(L_bi)][0] [len(L_bi)] dp len(L_bi) len L_bi 0 dp[len(L_bi)][1] [len(L_bi)] dp len(L_bi) len L_bi 1 mod keta = len(L) len(L) keta scale = 2 2 scale scale = 1 1 scale L_bi = L L L_bi mod = 1000000007 1000000007 mod dp = [[0 for _ in range(2)] for _ in range(1000002)] [[0 for _ in range(2)] for _ in range(1000002)] dp L = input() input() L
L = input()
L_bi = L
keta = len(L)
mod = 1000000007

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

for i in range(len(L_bi)):
    for j in range(2):
        if j == 1:
            scale = 2
        else:
            scale = 1
        dp[i+1][0] = (dp[i+1][0] + scale*dp[i][0])%mod
        if int(L_bi[i]) > j:
            dp[i+1][0] = (dp[i+1][0] + scale*dp[i][1])%mod
        elif int(L_bi[i]) == j:
            dp[i+1][1] = (dp[i+1][1] + scale*dp[i][1])%mod
print((dp[len(L_bi)][0]+dp[len(L_bi)][1])%mod)