#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
int main() {
  vector<long long> pow2(101);
  pow2[0] = 1;
  for (int i = 1; i <= 100; i++) pow2[i] = pow2[i - 1] * 2LL % MOD;
  string x;
  cin >> x;
  int n = x.size();
  long long res = 0;
  for (int i = 0; i < n; i++) {
    if (x[n - i - 1] == '1') {
      long long s = pow2[i];
      res = (res + (((s * s) % MOD) * (pow2[n - i - 1])) % MOD) % MOD;
    }
  }
  cout << res << endl;
  return 0;
}
