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