#include <bits/stdc++.h>
char x[200];
int p[300];
int main() {
  scanf("%s", x);
  int n = strlen(x);
  p[0] = 1;
  for (int i = 1; i < 300; i++) p[i] = (p[i - 1] * 2) % 1000000007;
  int ans = 0;
  for (int i = 0; i < n; i++)
    if (x[i] == '1') ans = (ans + p[(n - 1) * 2 - i]) % 1000000007;
  printf("%d\n", ans);
  return 0;
}
