import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 1000000007
sys.setrecursionlimit(1000000)

L = rs()

n = len(L)
dp = [[0]*2 for i in range(n+1)]
dp[0][0] = 1

for i in range(n):
	if L[i] == '0':
		dp[i+1][0] += dp[i][0] % mod # (0,0)
		dp[i+1][1] += dp[i][1] % mod # (0,0)
		dp[i+1][1] += dp[i][1]*2 % mod # (1,0), (0,1)
	else:
		dp[i+1][1] += dp[i][0] + dp[i][1] % mod # (0,0)
		dp[i+1][0] += dp[i][0]*2 % mod # (0,1), (1,0)
		dp[i+1][1] += dp[i][1]*2 % mod # (0,1), (1,0)
print((dp[n][0]+dp[n][1])%mod) import sys, math sys math from collections import defaultdict, deque, Counter from bisect import bisect_left, bisect_right from itertools import combinations, permutations, product from heapq import heappush, heappop from functools import lru_cache input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline rs = lambda: input().strip() rs lambda: input().strip() input().strip() ().strip () input strip ri = lambda: int(input()) ri lambda: int(input()) int(input()) int input() input rl = lambda: list(map(int, input().split())) rl lambda: list(map(int, input().split())) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split mod = 1000000007 mod 1000000007 sys.setrecursionlimit(1000000) sys.setrecursionlimit sys setrecursionlimit 1000000 L = rs() L rs() rs n = len(L) n len(L) len L [0]*2 for i in range(n+1) for i in range(n+1) i range(n+1) range n+1 n 1 for i in range(n+1) [0]*2 [0] 0 2 dp = [[0]*2 for i in range(n+1)] dp [[0]*2 for i in range(n+1)] dp[0][0] = 1 dp[0][0] [0] dp 0 0 1 for i in range(n):
	if L[i] == '0':
		dp[i+1][0] += dp[i][0] % mod # (0,0)
		dp[i+1][1] += dp[i][1] % mod # (0,0)
		dp[i+1][1] += dp[i][1]*2 % mod # (1,0), (0,1)
	else:
		dp[i+1][1] += dp[i][0] + dp[i][1] % mod # (0,0)
		dp[i+1][0] += dp[i][0]*2 % mod # (0,1), (1,0)
		dp[i+1][1] += dp[i][1]*2 % mod # (0,1), (1,0) i range(n) range n if L[i] == '0':
		dp[i+1][0] += dp[i][0] % mod # (0,0)
		dp[i+1][1] += dp[i][1] % mod # (0,0)
		dp[i+1][1] += dp[i][1]*2 % mod # (1,0), (0,1)
	else:
		dp[i+1][1] += dp[i][0] + dp[i][1] % mod # (0,0)
		dp[i+1][0] += dp[i][0]*2 % mod # (0,1), (1,0)
		dp[i+1][1] += dp[i][1]*2 % mod # (0,1), (1,0) L[i] == '0' L[i] L i '0' dp[i+1][0] += dp[i][0] % mod dp[i+1][0] [i+1] dp i+1 i 1 0 dp[i][0] % mod dp[i][0] [i] dp i 0 mod dp[i+1][1] += dp[i][1] % mod dp[i+1][1] [i+1] dp i+1 i 1 1 dp[i][1] % mod dp[i][1] [i] dp i 1 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 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] [i] dp i 0 dp[i][1] % mod dp[i][1] [i] dp i 1 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 input = sys.stdin.readline sys.stdin.readline input rl = lambda: list(map(int, input().split())) lambda: list(map(int, input().split())) rl mod = 1000000007 1000000007 mod n = len(L) len(L) n ri = lambda: int(input()) lambda: int(input()) ri L = rs() rs() L rs = lambda: input().strip() lambda: input().strip() rs dp = [[0]*2 for i in range(n+1)] [[0]*2 for i in range(n+1)] dp
import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 1000000007
sys.setrecursionlimit(1000000)

L = rs()

n = len(L)
dp = [[0]*2 for i in range(n+1)]
dp[0][0] = 1

for i in range(n):
	if L[i] == '0':
		dp[i+1][0] += dp[i][0] % mod # (0,0)
		dp[i+1][1] += dp[i][1] % mod # (0,0)
		dp[i+1][1] += dp[i][1]*2 % mod # (1,0), (0,1)
	else:
		dp[i+1][1] += dp[i][0] + dp[i][1] % mod # (0,0)
		dp[i+1][0] += dp[i][0]*2 % mod # (0,1), (1,0)
		dp[i+1][1] += dp[i][1]*2 % mod # (0,1), (1,0)
print((dp[n][0]+dp[n][1])%mod)
