using System;
using System.Collections.Generic;
using static AtCoderer.Exter;
using static System.Math;
using System.Linq;

namespace AtCoderer
{

    public class App
    {
        public static void Solve()
        {
            var l = Console.ReadLine();
            var dp = new long[2, 2, l.Length];//今の0/1,今迄に超過を回避したか,何桁目
            dp[0, 1, 0] = 1;
            dp[1, 0, 0] = 2;
            dp[0, 0, 0] = 0;
            dp[1, 1, 0] = 0;
            for (int i = 1;i<l.Length;i++)
            {
                if(l[i] == '0')
                {
                    dp[0, 0, i] = (dp[1, 0, i - 1] + dp[0, 0, i - 1])% 1000000007;
                    dp[0, 1, i] = (dp[1, 1, i - 1] + dp[0, 1, i - 1]) % 1000000007;
                    dp[1, 1, i] = ((dp[1, 1, i - 1] + dp[0, 1, i - 1])*2) % 1000000007;
                }
                else
                {
                    dp[0, 1, i] = (dp[1, 1, i - 1] + dp[0, 1, i - 1] + dp[1, 0, i - 1] + dp[0, 0, i - 1]) % 1000000007;
                    dp[1, 0, i] = ((dp[1, 0, i - 1] + dp[0, 0, i - 1]) * 2)% 1000000007;
                    dp[1, 1, i] = ((dp[1, 1, i - 1] + dp[0, 1, i - 1]) * 2)% 1000000007;
                }
            }
            Console.WriteLine((dp[0, 0, l.Length - 1] + dp[0, 1, l.Length - 1] + dp[1, 0, l.Length - 1] + dp[1, 1, l.Length - 1]) % 1000000007);
        }
        public static void Main(string[] args)
        {
            Solve();
            Console.ReadKey();
        }
    }
    public static class Exter
    {
        public static void rep(int loop, Action<int> act)
        {
            for (int i = 0; i < loop; i++)
                act(i);
        }
        public static int Max(params int[] p) => p.Max();
        public static long Max(params long[] p) => p.Max();
        public static int Min(params int[] p) => p.Min();
        public static long Min(params long[] p) => p.Min();
        public static int Gcd(int a, int b) => a > b ? GcdRecursive(a, b) : GcdRecursive(b, a);
        private static int GcdRecursive(int a, int b) => b == 0 ? a : GcdRecursive(b, a % b);
        public static void EnumArr<t>(this IEnumerable<t> v)
        {
            Console.WriteLine(string.Join(",", v));
        }
        public static string ToString(this IEnumerable<char> v)
        {
            return string.Join(",", v);
        }
        public static int[] readarr
        {
            get
            {
                return Console.ReadLine().Split().Select(s => int.Parse(s)).ToArray();
            }
        }
        public class UnionFind
        {
            private int[] Parent;
            private int GetRoot(int v)
            {
                if (Parent[v] < 0)
                    return v;
                else
                    return Parent[v] = GetRoot(Parent[v]);
            }
            public UnionFind(int size)
            {
                Parent = new int[size];
                for (int i = 0; i < size; i++)
                    Parent[i] = -1;
            }
            public bool AreGrouped(int a, int b)
            {
                return GetRoot(a) == GetRoot(b);
            }
            public void Connect(int a, int b)
            {
                a = GetRoot(a);
                b = GetRoot(b);
                if (a == b) return;
                if (Parent[b] < Parent[a])
                {
                    Parent[b] += Parent[a];
                    Parent[a] = b;
                }
                else
                {
                    Parent[a] += Parent[b];
                    Parent[b] = a;
                }
            }
            public int GetGroupSize(int a)
            {
                return -Parent[GetRoot(a)];
            }
        }
    }
}


Measured memory_bytes: 14432