#include <bits/stdc++.h>
using namespace std;
long long mulmod(long long a, long long b, long long c) {
  c = 1000000007;
  long long x = 0, y = a % c;
  while (b > 0) {
    if (b % 2 == 1) x = (x + y) % c;
    y = (y * 2) % c;
    b /= 2;
  }
  return x % c;
}
int modulo(int a, int b, int c) {
  long long x = 1, y = a;
  c = 1000000007;
  while (b > 0) {
    if (b % 2 == 1) x = (x * y) % c;
    y = (y * y) % c;
    b /= 2;
  }
  return x % c;
}
long long conv(string a) {
  int siz = a.size() - 1;
  long long ret = 0;
  for (int i = siz; i >= 0; i--) {
    long long k = modulo(2, siz - i, 0);
    ret = (ret + k * (a[i] - '0')) % 1000000007;
  }
  return ret;
}
int main() {
  string a;
  cin >> a;
  cout << (conv(a) * modulo(2, a.size() - 1, 0)) % 1000000007 << endl;
  return 0;
}
