#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[100 + 10];
  scanf("%s", s);
  int n = strlen(s);
  long long ans = 0, base = (long long)1e9 + 7, two[200 + 10] = {0};
  two[0] = 1;
  for (long long i = 1; i <= 201; ++i) two[i] = (two[i - 1] * 2) % base;
  reverse(s, s + n);
  for (int i = 0; i < n; ++i)
    if (s[i] == '1') ans = (ans + two[n - 1 + i]) % base;
  cout << ans;
  return 0;
}
