mod=10**9+7

s=input()
n=len(s)

dp=[[0] * 2 for _ in range(100001)]

dp[0][0] =1

for i in range(n):
    if s[i] == '0':
        dp[i+1][0] = dp[i][0]
        dp[i+1][1] = dp[i][1]
    else:
        dp[i+1][1] = (dp[i][0] + dp[i][1]) % mod

    if s[i] == '0':
        dp[i+1][1] += dp[i][1]*2 % mod
    else:
        dp[i+1][0] += dp[i][0]*2 % mod
        dp[i+1][1] += dp[i][1]*2 % mod

print((dp[n][0]+dp[n][1]) % mod) mod=10**9+7 mod 10**9+7 10**9 10 9 7 s=input() s input() input n=len(s) n len(s) len s [0] * 2 for _ in range(100001) for _ in range(100001) _ range(100001) range 100001 for _ in range(100001) [0] * 2 [0] 0 2 dp=[[0] * 2 for _ in range(100001)] dp [[0] * 2 for _ in range(100001)] dp[0][0] =1 dp[0][0] [0] dp 0 0 1 for i in range(n):
    if s[i] == '0':
        dp[i+1][0] = dp[i][0]
        dp[i+1][1] = dp[i][1]
    else:
        dp[i+1][1] = (dp[i][0] + dp[i][1]) % mod

    if s[i] == '0':
        dp[i+1][1] += dp[i][1]*2 % mod
    else:
        dp[i+1][0] += dp[i][0]*2 % mod
        dp[i+1][1] += dp[i][1]*2 % mod i range(n) range n if s[i] == '0':
        dp[i+1][0] = dp[i][0]
        dp[i+1][1] = dp[i][1]
    else:
        dp[i+1][1] = (dp[i][0] + dp[i][1]) % mod

     s[i] == '0' s[i] s i '0' dp[i+1][0] = dp[i][0] dp[i+1][0] [i+1] dp i+1 i 1 0 dp[i][0] [i] dp i 0 dp[i+1][1] = dp[i][1] dp[i+1][1] [i+1] dp i+1 i 1 1 dp[i][1] [i] dp i 1 dp[i+1][1] = (dp[i][0] + dp[i][1]) % mod dp[i+1][1] [i+1] dp i+1 i 1 1 (dp[i][0] + dp[i][1]) % mod dp[i][0] + dp[i][1] dp[i][0] [i] dp i 0 dp[i][1] [i] dp i 1 mod if s[i] == '0':
        dp[i+1][1] += dp[i][1]*2 % mod
    else:
        dp[i+1][0] += dp[i][0]*2 % mod
        dp[i+1][1] += dp[i][1]*2 % mod s[i] == '0' s[i] s i '0' dp[i+1][1] += dp[i][1]*2 % mod dp[i+1][1] [i+1] dp i+1 i 1 1 dp[i][1]*2 % mod dp[i][1]*2 dp[i][1] [i] dp i 1 2 mod dp[i+1][0] += dp[i][0]*2 % mod dp[i+1][0] [i+1] dp i+1 i 1 0 dp[i][0]*2 % mod dp[i][0]*2 dp[i][0] [i] dp i 0 2 mod dp[i+1][1] += dp[i][1]*2 % mod dp[i+1][1] [i+1] dp i+1 i 1 1 dp[i][1]*2 % mod dp[i][1]*2 dp[i][1] [i] dp i 1 2 mod print((dp[n][0]+dp[n][1]) % mod) print (dp[n][0]+dp[n][1]) % mod dp[n][0]+dp[n][1] dp[n][0] [n] dp n 0 dp[n][1] [n] dp n 1 mod mod=10**9+7 10**9+7 mod n=len(s) len(s) n s=input() input() s dp=[[0] * 2 for _ in range(100001)] [[0] * 2 for _ in range(100001)] dp
mod=10**9+7

s=input()
n=len(s)

dp=[[0] * 2 for _ in range(100001)]

dp[0][0] =1

for i in range(n):
    if s[i] == '0':
        dp[i+1][0] = dp[i][0]
        dp[i+1][1] = dp[i][1]
    else:
        dp[i+1][1] = (dp[i][0] + dp[i][1]) % mod

    if s[i] == '0':
        dp[i+1][1] += dp[i][1]*2 % mod
    else:
        dp[i+1][0] += dp[i][0]*2 % mod
        dp[i+1][1] += dp[i][1]*2 % mod

print((dp[n][0]+dp[n][1]) % mod)