#include <bits/stdc++.h>
int main() {
  int n, i = 0;
  long long sum = 0;
  char x[110];
  scanf("%s", x);
  n = strlen(x);
  while (x[i++] != 0) {
    if (x[i - 1] == 49) {
      sum += 1;
    }
    sum *= 2;
    if (i == n) sum /= 2;
    sum %= 1000000007;
  }
  for (i = 1; i < n; i++) {
    sum *= 2;
    sum %= 1000000007;
  }
  printf("%I64d\n", sum);
  return 0;
}
