#include <bits/stdc++.h>
using namespace std;
char s[100];
int main() {
  scanf("%s", s);
  int n;
  long long r, R, rr;
  int i;
  for (n = 0; s[n] != 0; n++) {
  }
  r = 1;
  for (i = 0; i < n - 1; i++) {
    r = (r * 2) % 1000000007;
  }
  R = 1;
  rr = 0;
  for (i = n - 1; i >= 0; i--) {
    if (s[i] == '1') {
      rr = (rr + r * R) % 1000000007;
    }
    R = (R * 2) % 1000000007;
  }
  cout << rr << endl;
  return 0;
}
