@l = gets.chomp
@n = @l.size
M = 10 ** 9 + 7

def pow(x, n)
    n == 0 ? 1 : (n.odd? ? x : 1) * pow(x ** 2 % M, n / 2) % M
end

@fac = Array.new(@n+1, 1)
1.upto(@n) {|i| @fac[i] = @fac[i-1] * i % M}

@rfac = Array.new(@n+1)
@rfac[-1] = pow(@fac[-1], M - 2)
(@n-1).downto(0) {|i| @rfac[i] = @rfac[i+1] * (i+1) % M}

def calc(i)
    if i == @n
        1
    elsif @l[i] == ?1
        sum = calc(i+1) * 2
        (@n-i).times do |j|
            x = @fac[@n-i-1] * @rfac[j] * @rfac[@n-i-j-1] % M
            sum += x * pow(2, @n-i-j-1) % M
        end
        sum %= M
    else
        calc(i+1)
    end
end

p calc(0)