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

dp = [[0,0] for i in range(N+1)]
dp[0][0] = 1
for i,a in enumerate(L):
    a = int(a)
    for less in range(2):
        for d in range(2):
            if less==0 and d > a: continue
            nl = int(less or d < a)
            dp[i+1][nl] += dp[i][less] * (d+1)
    dp[i+1][0] %= MOD
    dp[i+1][1] %= MOD

print(sum(dp[-1]) % 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,0] for i in range(N+1) for i in range(N+1) i range(N+1) range N+1 N 1 for i in range(N+1) [0,0] 0 0 dp = [[0,0] for i in range(N+1)] dp [[0,0] for i in range(N+1)] dp[0][0] = 1 dp[0][0] [0] dp 0 0 1 for i,a in enumerate(L):
    a = int(a)
    for less in range(2):
        for d in range(2):
            if less==0 and d > a: continue
            nl = int(less or d < a)
            dp[i+1][nl] += dp[i][less] * (d+1)
    dp[i+1][0] %= MOD
    dp[i+1][1] %= MOD i a enumerate(L) enumerate L a = int(a) a int(a) int a for less in range(2):
        for d in range(2):
            if less==0 and d > a: continue
            nl = int(less or d < a)
            dp[i+1][nl] += dp[i][less] * (d+1)
     less range(2) range 2 for d in range(2):
            if less==0 and d > a: continue
            nl = int(less or d < a)
            dp[i+1][nl] += dp[i][less] * (d+1)
     d range(2) range 2 if less==0 and d > a: continue
             less==0 and d > a less==0 less 0 d > a d a nl = int(less or d < a) nl int(less or d < a) int less or d < a less d < a d a dp[i+1][nl] += dp[i][less] * (d+1) dp[i+1][nl] [i+1] dp i+1 i 1 nl dp[i][less] * (d+1) dp[i][less] [i] dp i less d+1 d 1 dp[i+1][0] %= MOD dp[i+1][0] [i+1] dp i+1 i 1 0 MOD dp[i+1][1] %= MOD dp[i+1][1] [i+1] dp i+1 i 1 1 MOD print(sum(dp[-1]) % MOD) print sum(dp[-1]) % MOD sum(dp[-1]) sum dp[-1] dp -1 MOD L = input() input() L MOD = 10**9+7 10**9+7 MOD a = int(a) int(a) a N = len(L) len(L) N nl = int(less or d < a) int(less or d < a) nl dp = [[0,0] for i in range(N+1)] [[0,0] for i in range(N+1)] dp
L = input()
N = len(L)
MOD = 10**9+7

dp = [[0,0] for i in range(N+1)]
dp[0][0] = 1
for i,a in enumerate(L):
    a = int(a)
    for less in range(2):
        for d in range(2):
            if less==0 and d > a: continue
            nl = int(less or d < a)
            dp[i+1][nl] += dp[i][less] * (d+1)
    dp[i+1][0] %= MOD
    dp[i+1][1] %= MOD

print(sum(dp[-1]) % MOD)