#include <bits/stdc++.h>
using namespace std;
const double PI = 3.1415926535;
string x;
int n, t, k;
int MOD = 1000000007;
int main() {
  cin >> x;
  n = x.length();
  for (int i = 0; i < n; ++i) {
    t <<= 1;
    t += x[i] - '0';
    t %= MOD;
  }
  for (int i = 0; i < n - 1; ++i) {
    t <<= 1;
    t %= MOD;
  }
  cout << t;
  return 0;
}
