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