#include <bits/stdc++.h>
char s[110];
long long MOD = 1000000007LL;
long long qpow(long long a, long long b) {
  long long rtn = 1;
  while (b) {
    if (b & 1) rtn = (rtn * a) % MOD;
    a = (a * a) % MOD;
    b >>= 1;
  }
  return rtn % MOD;
}
long long calc(char *str, int len) {
  long long rst;
  if (len == 1) {
    if (str[0] == '1') return 1;
    return 0;
  }
  rst = (2 * calc(str + 1, len - 1)) % MOD;
  if (str[0] == '1')
    rst = (rst + (qpow(2, len - 1) * qpow(2, len - 1) % MOD)) % MOD;
  return rst;
}
int main() {
  while (~scanf("%s", s)) printf("%I64d\n", calc(s, strlen(s)));
  return 0;
}
