#include <bits/stdc++.h>
using namespace std;
int p[1000];
char str[1000];
int main() {
  int i, n, ans;
  p[0] = 1;
  for (i = 1; i < 1000; i++) p[i] = (p[i - 1] + p[i - 1]) % 1000000007;
  while (scanf("%s ", str) == 1) {
    n = strlen(str);
    ans = 0;
    for (i = 1; i <= n; i++)
      if (str[i - 1] == '1') ans = (ans + p[n + n - i - 1]) % 1000000007;
    printf("%d\n", ans);
  }
}
