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