L=input()
DIV=10**9+7
dp=[[0 for i in range(2)] for j in range(len(L))]

dp[0][0]=2
dp[0][1]=1

for i in range(1,len(L)):
  x=int(L[i])
  dp[i][0]=(dp[i-1][0]*2*(x==1)+dp[i-1][0]*1*(x==0))%DIV
  dp[i][1]=(dp[i-1][0]*1*(x==1)+dp[i-1][1]*3)%DIV

print((dp[-1][0]+dp[-1][1])%DIV) L=input() L input() input DIV=10**9+7 DIV 10**9+7 10**9 10 9 7 [0 for i in range(2)] for j in range(len(L)) for j in range(len(L)) j range(len(L)) range len(L) len L for j in range(len(L)) [0 for i in range(2)] dp=[[0 for i in range(2)] for j in range(len(L))] dp [[0 for i in range(2)] for j in range(len(L))] dp[0][0]=2 dp[0][0] [0] dp 0 0 2 dp[0][1]=1 dp[0][1] [0] dp 0 1 1 for i in range(1,len(L)):
  x=int(L[i])
  dp[i][0]=(dp[i-1][0]*2*(x==1)+dp[i-1][0]*1*(x==0))%DIV
  dp[i][1]=(dp[i-1][0]*1*(x==1)+dp[i-1][1]*3)%DIV i range(1,len(L)) range 1 len(L) len L x=int(L[i]) x int(L[i]) int L[i] L i dp[i][0]=(dp[i-1][0]*2*(x==1)+dp[i-1][0]*1*(x==0))%DIV dp[i][0] [i] dp i 0 (dp[i-1][0]*2*(x==1)+dp[i-1][0]*1*(x==0))%DIV dp[i-1][0]*2*(x==1)+dp[i-1][0]*1*(x==0) dp[i-1][0]*2*(x==1) dp[i-1][0]*2 dp[i-1][0] [i-1] dp i-1 i 1 0 2 x==1 x 1 dp[i-1][0]*1*(x==0) dp[i-1][0]*1 dp[i-1][0] [i-1] dp i-1 i 1 0 1 x==0 x 0 DIV dp[i][1]=(dp[i-1][0]*1*(x==1)+dp[i-1][1]*3)%DIV dp[i][1] [i] dp i 1 (dp[i-1][0]*1*(x==1)+dp[i-1][1]*3)%DIV dp[i-1][0]*1*(x==1)+dp[i-1][1]*3 dp[i-1][0]*1*(x==1) dp[i-1][0]*1 dp[i-1][0] [i-1] dp i-1 i 1 0 1 x==1 x 1 dp[i-1][1]*3 dp[i-1][1] [i-1] dp i-1 i 1 1 3 DIV print((dp[-1][0]+dp[-1][1])%DIV) print (dp[-1][0]+dp[-1][1])%DIV dp[-1][0]+dp[-1][1] dp[-1][0] [-1] dp -1 0 dp[-1][1] [-1] dp -1 1 DIV x=int(L[i]) int(L[i]) x dp=[[0 for i in range(2)] for j in range(len(L))] [[0 for i in range(2)] for j in range(len(L))] dp L=input() input() L DIV=10**9+7 10**9+7 DIV
L=input()
DIV=10**9+7
dp=[[0 for i in range(2)] for j in range(len(L))]

dp[0][0]=2
dp[0][1]=1

for i in range(1,len(L)):
  x=int(L[i])
  dp[i][0]=(dp[i-1][0]*2*(x==1)+dp[i-1][0]*1*(x==0))%DIV
  dp[i][1]=(dp[i-1][0]*1*(x==1)+dp[i-1][1]*3)%DIV

print((dp[-1][0]+dp[-1][1])%DIV)
