#include <bits/stdc++.h>
int main(void) {
  char s[105];
  scanf("%s", s);
  int l = strlen(s);
  int i, j, k;
  long long int ans = 0;
  long long int n = 1LL;
  for (i = l - 1; i >= 0; i--) {
    ans = (ans * 2) % 1000000007;
    if (s[i] == '1') {
      ans = (ans + (n * n) % 1000000007) % 1000000007;
    }
    n = (n * 2) % 1000000007;
  }
  printf("%I64d\n", ans);
  return 0;
}
