#include <bits/stdc++.h>
using namespace std;
char str[1000];
int main() {
  scanf("%s", str);
  int n = strlen(str);
  long long rsp = 0LL, val = 1;
  for (int i = 0; i < n - 1; i++) val = (val * 2LL) % 1000000007LL;
  for (int i = n - 1; i >= 0; i--) {
    if (str[i] == '1') {
      rsp = (rsp + val) % 1000000007LL;
    }
    val = (val * 2LL) % 1000000007LL;
  }
  printf("%lld\n", rsp);
  return 0;
}
