#include <bits/stdc++.h>
int mod = 1000000007;
int main() {
  long long n = 0, num = 0, p = 0;
  int i;
  char c;
  while (scanf("%c", &c) && c != '\n') {
    if (c == '1') {
      num *= 2;
      num++;
      num %= mod;
    } else
      num *= 2, num %= mod;
    n++;
  }
  n--;
  p = 1;
  for (i = 0; i < n; i++) {
    p *= 2;
    p %= mod;
  }
  p *= num;
  p %= mod;
  printf("%I64d\n", p);
  return 0;
}
