#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long qp(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans *= a, ans %= mod;
    a *= a, a %= mod;
    b >>= 1;
  }
  return ans;
}
signed main() {
  string s;
  cin >> s;
  long long l = s.length();
  long long n = l;
  long long ans1 = 0;
  for (long long i = 0; i < l; i++) {
    long long t = i + 1;
    if (s[i] == '1') {
      ans1 += qp(2, i) * qp(2, 2 * (n - t));
      ans1 %= mod;
    }
  }
  cout << ans1 << endl;
  return 0;
}
