L = input()
l = len(L)
dp = [[0]*2 for _ in range(100005)]
# dp[i][smaller]: i桁目までみる　未満なら1
# dp[i][1] : i桁目までみて、a, bどちらもL未満
# dp[i][0] : i桁目までみて、a+b = L
dp[0][0] = 1
mod = 10**9+7

for i in range(l):
  n = L[i]
  # a + b = 0
  if n == "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

  # a + b = 1
  if n == "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[l][0]+dp[l][1])%mod) L = input() L input() input l = len(L) l len(L) len L [0]*2 for _ in range(100005) for _ in range(100005) _ range(100005) range 100005 for _ in range(100005) [0]*2 [0] 0 2 dp = [[0]*2 for _ in range(100005)] dp [[0]*2 for _ in range(100005)] dp[0][0] = 1 dp[0][0] [0] dp 0 0 1 mod = 10**9+7 mod 10**9+7 10**9 10 9 7 for i in range(l):
  n = L[i]
  # a + b = 0
  if n == "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

  # a + b = 1
  if n == "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(l) range l n = L[i] n L[i] L i if n == "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

  # a + b = 1
   n == "0" n "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 n == "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 n == "0" n "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[l][0]+dp[l][1])%mod) print (dp[l][0]+dp[l][1])%mod dp[l][0]+dp[l][1] dp[l][0] [l] dp l 0 dp[l][1] [l] dp l 1 mod L = input() input() L n = L[i] L[i] n mod = 10**9+7 10**9+7 mod l = len(L) len(L) l dp = [[0]*2 for _ in range(100005)] [[0]*2 for _ in range(100005)] dp
L = input()
l = len(L)
dp = [[0]*2 for _ in range(100005)]
# dp[i][smaller]: i桁目までみる　未満なら1
# dp[i][1] : i桁目までみて、a, bどちらもL未満
# dp[i][0] : i桁目までみて、a+b = L
dp[0][0] = 1
mod = 10**9+7

for i in range(l):
  n = L[i]
  # a + b = 0
  if n == "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

  # a + b = 1
  if n == "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[l][0]+dp[l][1])%mod)