#include <bits/stdc++.h>
char s[205];
int n;
void init();
int work();
int main() {
  init();
  printf("%d\n", work());
}
int work() {
  int bin = 1, ans = 0;
  for (int i = n - 1; i >= 0; --i) {
    if (s[i] == '1') ans = (ans + bin) % 1000000007;
    bin = (bin << 1) % 1000000007;
  }
  return ans;
}
void init() {
  scanf("%s", s);
  n = strlen(s);
  for (int i = 0; i < n - 1; ++i) s[i + n] = '0';
  n = n + n - 1;
}
