#include <bits/stdc++.h>
using namespace std;
void read_file(bool outToFile = true) {}
int n;
int X[100 + 9];
char str[100 + 9];
int pwr(int x, int n) {
  if (n == 0) return 1;
  if (n % 2 == 1)
    return 1LL * x * pwr(x, n - 1) % (1000000007);
  else
    return pwr(1LL * x * x % (1000000007), n / 2);
}
int rec(int i = 0, int dep = 1) {
  if (i == n) return 0;
  int ret = 0;
  if (X[i] == 1) {
    ret += 1LL * pwr(2, 2 * (n - 1 - i)) * dep % (1000000007);
  }
  ret += rec(i + 1, dep * 2 % (1000000007));
  ret %= (1000000007);
  return ret;
}
int main() {
  read_file();
  while (scanf("%s", str) != EOF) {
    n = strlen(str);
    for (int i = 0; i < n; i++) X[i] = str[i] - '0';
    int ans;
    ans = rec();
    printf("%d\n", ans);
  }
}
