#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const int MAX = 200009;
int a[MAX] = {0};
char s[MAX];
long long pw(long long base, long long expo, long long c) {
  if (expo == 0) return 1;
  long long f = pw(base, expo / 2, c);
  if (expo & 1) return (((f * f) % c) * base) % c;
  return (f * f) % c;
}
int main() {
  int i, j, k;
  scanf("%s", s);
  ;
  int l = strlen(s);
  long long p = 1LL;
  long long x = pw(2, l - 1, 1000000007);
  long long ans = 0;
  for (i = l - 1; i >= 0; i--) {
    if (s[i] - '0') {
      ans = (ans + p) % 1000000007;
    }
    p = (p * 2) % 1000000007;
  }
  printf("%lld\n", (ans * x) % 1000000007);
  return 0;
}
