#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, long long int y, long long int mod) {
  long long int res = 1;
  x = x % mod;
  while (y > 0) {
    if (y & 1) res = (res * x) % mod;
    y = y >> 1;
    x = (x * x) % mod;
  }
  return res;
}
int main() {
  string x;
  cin >> x;
  long long int n = x.length();
  long long int val = 0;
  for (long long int i = n - 1; i >= 0; i--) {
    if (x[i] == '1') {
      val += (power(2, n - i - 1, 1000000007));
    }
  }
  long long int p = power(2, n - 1, 1000000007);
  cout << (val % 1000000007 * p % 1000000007) % 1000000007;
}
