#include <bits/stdc++.h>
const long long inf = 0x3f3f3f3f3f3f3f3LL;
const long long mod = (long long)1e9 + 7;
using namespace std;
template <class T>
void smin(T& a, T val) {
  if (a > val) a = val;
}
template <class T>
void smax(T& a, T val) {
  if (a < val) a = val;
}
const long long N = 5 * (long long)1e5 + 10;
long long n;
string s;
vector<pair<long long, long long> > v;
long long power(long long a, long long b, long long m = mod) {
  if (b < 0) b += m - 1;
  long long r = 1;
  while (b) {
    if (b & 1) r = (r * a) % m;
    a = (a * a) % m;
    b >>= 1;
  }
  return r;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> s;
  n = (long long)(s.size());
  long long num = 0;
  for (long long i = n - 1; i >= 0; --i) {
    if (s[i] == '0') continue;
    num += power(2LL, n - 1 - i);
    num %= mod;
  }
  long long mult = power(2, n - 1);
  long long ans = (num * mult) % mod;
  cout << ans;
  return 0;
}
