#include <bits/stdc++.h>
using namespace std;
const int mod = 1000 * 1000 * 1000 + 7;
string x;
int n;
long long ans = 0, num;
long long binpow(long long x, int p) {
  long long res = 1;
  while (p) {
    if (p & 1) {
      res = (res * x) % mod;
      p--;
    } else {
      x = (x * x) % mod;
      p /= 2;
    }
  }
  return res;
}
int main() {
  getline(cin, x);
  n = (int)x.length();
  ans = binpow(2ll, n - 1);
  for (int i = 0; i < n; i++) {
    num = (num * 2) % mod;
    if (x[i] == '1') {
      num = (num + 1) % mod;
    }
  }
  ans = (ans * num) % mod;
  cout << ans;
  return 0;
}
