# coding: utf-8
import re
import math
import fractions
import random
from heapq import heappop,heappush
import time
import sys
input = sys.stdin.readline
#import numpy as np
mod=int(10**9+7)
inf=int(10**20)
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def comb(n,r):return math.factorial(n)//math.factorial(n-r)//math.factorial(r)
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
 

 
#main
L=input()
dp=[[0,0] for _ in range(len(L)+5)]
dp[0][0]=1

ans=0
for a in range(len(L)-1):
    c=L[a]
    #a+b=0
    if c=="0":
        dp[a+1][0]=dp[a][0]
        dp[a+1][1]=dp[a][1]
    else:
        dp[a+1][1]=dp[a][1]+dp[a][0]
    #a+b=1
    if c=="0":
        dp[a+1][1]+=dp[a][1]*2
    else:
        dp[a+1][0]+=dp[a][0]*2
        dp[a+1][1]+=dp[a][1]*2
    dp[a+1][0]%=mod
    dp[a+1][1]%=mod
print((dp[len(L)-1][0]+dp[len(L)-1][1])%mod) import re re import math math import fractions fractions import random random from heapq import heappop,heappush import time time import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline mod=int(10**9+7) mod int(10**9+7) int 10**9+7 10**9 10 9 7 inf=int(10**20) inf int(10**20) int 10**20 10 20 class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S) union_find def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
     __init__ self.n=n self.n self n n a for a in range(N) for a in range(N) a range(N) range N for a in range(N) a self.P=[a for a in range(N)] self.P self P [a for a in range(N)] self.rank=[0]*n self.rank self rank [0]*n [0] 0 n self self n n def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
     find if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
         x!=self.P[x] x self.P[x] self.P self P x return self.P[x] self.P[x] self.P self P x self self x x def same(self,x,y):
        return self.find(x)==self.find(y)
 
     same return self.find(x)==self.find(y) self.find(x)==self.find(y) self.find(x) self.find self find x self.find(y) self.find self find y self self x x y y def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
     link if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
     self.rank[x]<self.rank[y] self.rank[x] self.rank self rank x self.rank[y] self.rank self rank y self.P[x]=y self.P[x] self.P self P x y elif self.rank[y]<self.rank[x]:
            self.P[y]=x
         self.rank[y]<self.rank[x] self.rank[y] self.rank self rank y self.rank[x] self.rank self rank x self.P[y]=x self.P[y] self.P self P y x self.P[x]=y self.P[x] self.P self P x y self.rank[y]+=1 self.rank[y] self.rank self rank y 1 self self x x y y def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
     unite self.link(self.find(x),self.find(y)) self.link self link self.find(x) self.find self find x self.find(y) self.find self find y self self x x y y def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S) size S=set() S set() set for a in range(self.n):
            S.add(self.find(a))
         a range(self.n) range self.n self n S.add(self.find(a)) S.add S add self.find(a) self.find self find a return len(S) len(S) len S self self def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A bin_ A=[0]*size A [0]*size [0] 0 size for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
     a range(size) range size if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
     (num>>(size-a-1))&1==1 (num>>(size-a-1))&1 num>>(size-a-1) num size-a-1 size-a size a 1 1 1 A[a]=1 A[a] A a 1 A[a]=0 A[a] A a 0 return A A num num size size def comb(n,r):return math.factorial(n)//math.factorial(n-r)//math.factorial(r) comb n n r r def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
 

 
#main next_comb x=num&(-num) x num&(-num) num -num num y=num+x y num+x num x z=num&(~y) z num&(~y) num ~y y z//=x z x z=z>>1 z z>>1 z 1 num=(y|z) num y|z y z if(num>=(1<<size)):return False
    else:
        return num
 

 
#main num>=(1<<size) num 1<<size 1 size return num num num num size size L=input() L input() input [0,0] for _ in range(len(L)+5) for _ in range(len(L)+5) _ range(len(L)+5) range len(L)+5 len(L) len L 5 for _ in range(len(L)+5) [0,0] 0 0 dp=[[0,0] for _ in range(len(L)+5)] dp [[0,0] for _ in range(len(L)+5)] dp[0][0]=1 dp[0][0] [0] dp 0 0 1 ans=0 ans 0 for a in range(len(L)-1):
    c=L[a]
    #a+b=0
    if c=="0":
        dp[a+1][0]=dp[a][0]
        dp[a+1][1]=dp[a][1]
    else:
        dp[a+1][1]=dp[a][1]+dp[a][0]
    #a+b=1
    if c=="0":
        dp[a+1][1]+=dp[a][1]*2
    else:
        dp[a+1][0]+=dp[a][0]*2
        dp[a+1][1]+=dp[a][1]*2
    dp[a+1][0]%=mod
    dp[a+1][1]%=mod a range(len(L)-1) range len(L)-1 len(L) len L 1 c=L[a] c L[a] L a if c=="0":
        dp[a+1][0]=dp[a][0]
        dp[a+1][1]=dp[a][1]
    else:
        dp[a+1][1]=dp[a][1]+dp[a][0]
    #a+b=1
     c=="0" c "0" dp[a+1][0]=dp[a][0] dp[a+1][0] [a+1] dp a+1 a 1 0 dp[a][0] [a] dp a 0 dp[a+1][1]=dp[a][1] dp[a+1][1] [a+1] dp a+1 a 1 1 dp[a][1] [a] dp a 1 dp[a+1][1]=dp[a][1]+dp[a][0] dp[a+1][1] [a+1] dp a+1 a 1 1 dp[a][1]+dp[a][0] dp[a][1] [a] dp a 1 dp[a][0] [a] dp a 0 if c=="0":
        dp[a+1][1]+=dp[a][1]*2
    else:
        dp[a+1][0]+=dp[a][0]*2
        dp[a+1][1]+=dp[a][1]*2
     c=="0" c "0" dp[a+1][1]+=dp[a][1]*2 dp[a+1][1] [a+1] dp a+1 a 1 1 dp[a][1]*2 dp[a][1] [a] dp a 1 2 dp[a+1][0]+=dp[a][0]*2 dp[a+1][0] [a+1] dp a+1 a 1 0 dp[a][0]*2 dp[a][0] [a] dp a 0 2 dp[a+1][1]+=dp[a][1]*2 dp[a+1][1] [a+1] dp a+1 a 1 1 dp[a][1]*2 dp[a][1] [a] dp a 1 2 dp[a+1][0]%=mod dp[a+1][0] [a+1] dp a+1 a 1 0 mod dp[a+1][1]%=mod dp[a+1][1] [a+1] dp a+1 a 1 1 mod print((dp[len(L)-1][0]+dp[len(L)-1][1])%mod) print (dp[len(L)-1][0]+dp[len(L)-1][1])%mod dp[len(L)-1][0]+dp[len(L)-1][1] dp[len(L)-1][0] [len(L)-1] dp len(L)-1 len(L) len L 1 0 dp[len(L)-1][1] [len(L)-1] dp len(L)-1 len(L) len L 1 1 mod input = sys.stdin.readline sys.stdin.readline input mod=int(10**9+7) int(10**9+7) mod c=L[a] L[a] c ans=0 0 ans def comb(n,r):return math.factorial(n)//math.factorial(n-r)//math.factorial(r) def comb(n,r):return math.factorial(n)//math.factorial(n-r)//math.factorial(r) comb def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
 

 
#main def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
 

 
#main next_comb L=input() input() L def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A bin_ inf=int(10**20) int(10**20) inf class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S) class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S) union_find dp=[[0,0] for _ in range(len(L)+5)] [[0,0] for _ in range(len(L)+5)] dp
# coding: utf-8
import re
import math
import fractions
import random
from heapq import heappop,heappush
import time
import sys
input = sys.stdin.readline
#import numpy as np
mod=int(10**9+7)
inf=int(10**20)
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def comb(n,r):return math.factorial(n)//math.factorial(n-r)//math.factorial(r)
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
 

 
#main
L=input()
dp=[[0,0] for _ in range(len(L)+5)]
dp[0][0]=1

ans=0
for a in range(len(L)-1):
    c=L[a]
    #a+b=0
    if c=="0":
        dp[a+1][0]=dp[a][0]
        dp[a+1][1]=dp[a][1]
    else:
        dp[a+1][1]=dp[a][1]+dp[a][0]
    #a+b=1
    if c=="0":
        dp[a+1][1]+=dp[a][1]*2
    else:
        dp[a+1][0]+=dp[a][0]*2
        dp[a+1][1]+=dp[a][1]*2
    dp[a+1][0]%=mod
    dp[a+1][1]%=mod
print((dp[len(L)-1][0]+dp[len(L)-1][1])%mod)