#include <bits/stdc++.h>
using namespace std;
long long pow(long long a, long long b) {
  long long r = 1;
  while (b > 0) {
    if (b % 2) r = (r * a) % 1000000007;
    a = (a * a) % 1000000007;
    b /= 2;
  }
  return r;
}
int main() {
  string s;
  cin >> s;
  long long n = s.size();
  long long four = pow(4, n - 1);
  long long two = 2;
  long long res = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '1') {
      res = (res + two * four) % 1000000007;
    }
    four = (four * 250000002) % 1000000007;
    two = (two * 2) % 1000000007;
  }
  cout << (res * 500000004) % 1000000007 << endl;
}
