#include <bits/stdc++.h>
using namespace std;
const int M = 1000000007;
char a[200];
int two[200];
int main() {
  two[0] = 1;
  for (int i = 1; i < 200; i++) two[i] = 2LL * two[i - 1] % M;
  while (~scanf("%s", a)) {
    int n = strlen(a);
    int ans = 0;
    for (int i = 0; i < n; i++)
      if (a[i] == '1') {
        ans = (ans + 1LL * two[i] * two[n - i - 1] % M * two[n - i - 1]) % M;
      }
    printf("%d\n", ans);
  }
}
