L = gets.chomp
MOD = 10**9 + 7
dpr = [1]*(10**5+1)

dpr[1] = 3
(10**5).times do |i|
  dpr[i+2] = dpr[i+1] * 3
  dpr[i+2] %= MOD
end

len = L.length
l = 1
ans = 0
len.times do |i|
  c = L[i]
  if c == "1"
    ans += (dpr[len-i-1] * l) % MOD
    ans %= MOD
    l = (l*2) % MOD
  end
end
ans += l
p ans % MOD
