mod = 10 ** 9 + 7

L = input()
N = len(L)

dp = [[0] * 2 for _ in range(N + 10)]
dp[0][0] = 1

for i in range(N):
    nd = int(L[i])
    for a in range(2):
        for b in range(2):
            if a == b == 1:  # 繰り上がっちゃう(a+b>L)
                continue
            for k in range(2):
                ni = i + 1
                nk = k
                if nk == 0:
                    if nd == 1 and a == 0 and b == 0:
                        nk += 1
                    if nd == 0 and a | b > 0:
                        continue
                dp[ni][nk] += dp[i][k]
                dp[ni][nk] %= mod

ans = 0
for k in range(2):
    ans += dp[N][k]
    ans %= mod

print(ans) mod = 10 ** 9 + 7 mod 10 ** 9 + 7 10 ** 9 10 9 7 L = input() L input() input N = len(L) N len(L) len L [0] * 2 for _ in range(N + 10) for _ in range(N + 10) _ range(N + 10) range N + 10 N 10 for _ in range(N + 10) [0] * 2 [0] 0 2 dp = [[0] * 2 for _ in range(N + 10)] dp [[0] * 2 for _ in range(N + 10)] dp[0][0] = 1 dp[0][0] [0] dp 0 0 1 for i in range(N):
    nd = int(L[i])
    for a in range(2):
        for b in range(2):
            if a == b == 1:  # 繰り上がっちゃう(a+b>L)
                continue
            for k in range(2):
                ni = i + 1
                nk = k
                if nk == 0:
                    if nd == 1 and a == 0 and b == 0:
                        nk += 1
                    if nd == 0 and a | b > 0:
                        continue
                dp[ni][nk] += dp[i][k]
                dp[ni][nk] %= mod i range(N) range N nd = int(L[i]) nd int(L[i]) int L[i] L i for a in range(2):
        for b in range(2):
            if a == b == 1:  # 繰り上がっちゃう(a+b>L)
                continue
            for k in range(2):
                ni = i + 1
                nk = k
                if nk == 0:
                    if nd == 1 and a == 0 and b == 0:
                        nk += 1
                    if nd == 0 and a | b > 0:
                        continue
                dp[ni][nk] += dp[i][k]
                dp[ni][nk] %= mod a range(2) range 2 for b in range(2):
            if a == b == 1:  # 繰り上がっちゃう(a+b>L)
                continue
            for k in range(2):
                ni = i + 1
                nk = k
                if nk == 0:
                    if nd == 1 and a == 0 and b == 0:
                        nk += 1
                    if nd == 0 and a | b > 0:
                        continue
                dp[ni][nk] += dp[i][k]
                dp[ni][nk] %= mod b range(2) range 2 if a == b == 1:  # 繰り上がっちゃう(a+b>L)
                continue
             a == b == 1 a == b a b 1 continue for k in range(2):
                ni = i + 1
                nk = k
                if nk == 0:
                    if nd == 1 and a == 0 and b == 0:
                        nk += 1
                    if nd == 0 and a | b > 0:
                        continue
                dp[ni][nk] += dp[i][k]
                dp[ni][nk] %= mod k range(2) range 2 ni = i + 1 ni i + 1 i 1 nk = k nk k if nk == 0:
                    if nd == 1 and a == 0 and b == 0:
                        nk += 1
                    if nd == 0 and a | b > 0:
                        continue
                 nk == 0 nk 0 if nd == 1 and a == 0 and b == 0:
                        nk += 1
                     nd == 1 and a == 0 and b == 0 nd == 1 and a == 0 nd == 1 nd 1 a == 0 a 0 b == 0 b 0 nk += 1 nk 1 if nd == 0 and a | b > 0:
                        continue
                 nd == 0 and a | b > 0 nd == 0 nd 0 a | b > 0 a | b a b 0 continue dp[ni][nk] += dp[i][k] dp[ni][nk] [ni] dp ni nk dp[i][k] [i] dp i k dp[ni][nk] %= mod dp[ni][nk] [ni] dp ni nk mod ans = 0 ans 0 for k in range(2):
    ans += dp[N][k]
    ans %= mod k range(2) range 2 ans += dp[N][k] ans dp[N][k] [N] dp N k ans %= mod ans mod print(ans) print ans mod = 10 ** 9 + 7 10 ** 9 + 7 mod ans += dp[N][k] dp[N][k] ans L = input() input() L dp = [[0] * 2 for _ in range(N + 10)] [[0] * 2 for _ in range(N + 10)] dp nd = int(L[i]) int(L[i]) nd nk = k k nk ans = 0 0 ans nk += 1 1 nk N = len(L) len(L) N ans %= mod mod ans ni = i + 1 i + 1 ni
mod = 10 ** 9 + 7

L = input()
N = len(L)

dp = [[0] * 2 for _ in range(N + 10)]
dp[0][0] = 1

for i in range(N):
    nd = int(L[i])
    for a in range(2):
        for b in range(2):
            if a == b == 1:  # 繰り上がっちゃう(a+b>L)
                continue
            for k in range(2):
                ni = i + 1
                nk = k
                if nk == 0:
                    if nd == 1 and a == 0 and b == 0:
                        nk += 1
                    if nd == 0 and a | b > 0:
                        continue
                dp[ni][nk] += dp[i][k]
                dp[ni][nk] %= mod

ans = 0
for k in range(2):
    ans += dp[N][k]
    ans %= mod

print(ans)