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