#include <bits/stdc++.h>
using namespace std;
long long int base = 1000000007;
int main() {
  long long int n, i, sum = 0, multi = 1, re = 1;
  char c[105];
  scanf("%s", c);
  n = strlen(c);
  for (i = n - 1; i >= 0; i--) {
    if (c[i] == '1') {
      sum = (sum + multi) % base;
    }
    multi = (multi * 2) % base;
  }
  multi = 1;
  for (i = 1; i <= n - 1; i++) {
    re = (re * 2) % base;
  }
  sum = (sum * re) % base;
  cout << sum << endl;
  return 0;
}
