#include <bits/stdc++.h>
using namespace std;
char c[110];
void go() {
  scanf("%s", c);
  int l = strlen(c);
  long long int b2 = 1, ans = 0;
  for (int i = l - 1; i >= 0; i--) {
    if (c[i] == '1') ans = (ans + b2) % 1000000007;
    if (i) b2 = (b2 * 2) % 1000000007;
  }
  ans = ans * b2 % 1000000007;
  printf("%d\n", (int)ans);
}
int main() {
  go();
  return 0;
}
