#include <bits/stdc++.h>
const long long mod = 1e9 + 7;
using namespace std;
long long pw[205];
long long get(long long n) {
  long long first = pw[n];
  first = first * (first - 1);
  first %= mod;
  first *= 500000004LL;
  return first % mod;
}
int32_t main() {
  pw[0] = 1;
  bool one = 0;
  for (long long i = 1; i < 205; i++) {
    pw[i] = pw[i - 1] * 2LL;
    pw[i] %= mod;
  }
  string s;
  cin >> s;
  long long n = s.size();
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    long long p = n - i;
    if (s[i] == '1') {
      one = 1;
      ans += pw[2 * n - i - 2];
    }
    ans %= mod;
  }
  if (!one) ans = 0;
  cout << ans << '\n';
  return 0;
}
