#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[110];
  cin >> (s + 1);
  int N = strlen(s + 1), Mo = 1000000007, i;
  long long a[110] = {1};
  for (i = 1; i <= 100; i++) a[i] = (a[i - 1] * 2) % Mo;
  long long ans = 0;
  for (i = 1; i <= N; i++)
    if (s[i] == '1')
      ans = (ans + a[N - i] * a[N - i] % Mo * a[i - 1] % Mo) % Mo;
  cout << ans << endl;
}
