#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int N = 105;
long long ans = 0;
int n;
char s[N];
long long pang(long long x, long long y) {
  if (y == 0) return 1;
  if (y == 1) return x;
  long long ret = pang(x, y / 2);
  ret = (ret * ret) % MOD;
  if (y & 1) ret = (ret * x) % MOD;
  return ret;
}
int main() {
  scanf("%s", s);
  n = strlen(s);
  long long split = 1;
  for (int i = 0; i < n; i++) {
    if (s[i] == '1') {
      long long now = pang(2, n - i - 1);
      now = (now * now) % MOD;
      now = (now * split) % MOD;
      ans = (ans + now) % MOD;
    }
    split = (split + split) % MOD;
  }
  printf("%lld\n", ans);
  return 0;
}
