#include <bits/stdc++.h>
using namespace std;
char A[1100];
long long n, p[1010];
long long f(long long i) {
  long long j, temp;
  if (i == n - 1) {
    if (A[i] == '0')
      return 0;
    else
      return 1;
  }
  if (A[i] == '0') {
    return (2 * f(i + 1)) % 1000000007;
  } else {
    return (2 * f(i + 1) + p[2 * (n - i - 1)]) % 1000000007;
  }
}
int main() {
  long long i, j, k;
  p[0] = 1;
  for (i = 1; i < 1001; i++) p[i] = (2 * p[i - 1]) % 1000000007;
  scanf("%s", A);
  n = strlen(A);
  printf("%I64d\n", f(0));
  return 0;
}
