MOD = 10 ** 9 + 7

def sum_equals_xor(l)
  dp = Array.new(l.size + 1) { Array.new(2) { 0 } }
  dp[0][0] = 1

  l.each_char.with_index do |c, i|
    # a+b = 0
    if c == '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]
    end

    # a+b = 1
    if c == '0'
      dp[i + 1][1] += dp[i][1] * 2
    else
      dp[i + 1][0] += dp[i][0] * 2
      dp[i + 1][1] += dp[i][1] * 2
    end
  end

  (dp[l.size][0] + dp[l.size][1]) % MOD
end

puts sum_equals_xor(gets.chomp)