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