#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[10000];
  scanf("%s", a);
  long long int i;
  long long int n = strlen(a), j;
  long long int offset = 1;
  for (i = 0; i < n - 1; i++) {
    offset = (offset * 2) % 1000000007;
  }
  long long int ans = 0, pre = 1, temp;
  int p = n - 1;
  for (i = 0; i < n; i++) {
    if (a[i] == '1') {
      temp = (offset * offset) % 1000000007;
      temp = (temp * pre) % 1000000007;
      ans += temp;
      ans = ans % 1000000007;
    }
    pre = (pre * 2) % 1000000007;
    offset = (offset * 500000004) % 1000000007;
  }
  cout << ans << "\n";
  return 0;
}
