#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T fastModPow(T Base, T Power, T Mod) {
  T Result = 1;
  while (Power > 0) {
    if (Power & 1) Result = (Result * Base) % Mod;
    Power >>= 1;
    Base = (Base * Base) % Mod;
  }
  return (Result % Mod);
}
int main() {
  long long n, v = 0, m = 1000000007, r;
  string s;
  cin >> s;
  n = (int)s.length();
  for (int i = 0; i < n; i++) v = (v * 2 + s[i] - '0') % m;
  r = fastModPow(2ll, n - 1, m);
  r = (r * v) % m;
  cout << r << endl;
  return 0;
}
