let s = Array(readLine()!)
let n = s.count
let mod = 1000000007

var dp: [[Int]] = .init(repeating: .init(repeating: 0, count: 2), count: n + 1)

dp[0][0] = 1

for i in 0..<n {
  if s[i] == "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
  }
  if s[i] == "0" {
    dp[i+1][1] += dp[i][1] * 2 % mod
    dp[i+1][1] %= mod
  } else {
    dp[i+1][0] += dp[i][0] * 2 % mod
    dp[i+1][0] %= mod
    dp[i+1][1] += dp[i][1] * 2 % mod
    dp[i+1][1] %= mod
  }
}
print((dp[n][0] + dp[n][1]) % mod)