#include <bits/stdc++.h>
using namespace std;
char x[111];
long long f[111];
int r(int u) {
  if (u == 1) return 2;
  return (2 * r(u - 1)) % 1000000007;
}
int main() {
  scanf("%s", x + 1);
  int n = strlen(x + 1);
  if (x[1] == '0') f[1] = 0;
  if (x[1] == '1') f[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (x[i] == '1')
      f[i] = (4 * f[i - 1] + r(i - 1)) % 1000000007;
    else
      f[i] = (4 * f[i - 1]) % 1000000007;
  }
  long long ans = f[n];
  printf("%I64d\n", ans);
  return 0;
}
