#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int MAXN = 110;
int N;
long long rez;
char sir[MAXN];
long long getPut(int pow) {
  long long a = 1;
  for (int i = 1; i < pow; ++i) {
    a = (a * 2) % MOD;
  }
  a = (a * a) % MOD;
  return a;
}
int main() {
  cin.getline(sir, MAXN);
  N = strlen(sir);
  long long put = 1;
  for (int i = 0; i < N; ++i) {
    if (sir[i] == '1') rez = (rez + getPut(N - i) * put) % MOD;
    put = (put * 2) % MOD;
  }
  cout << rez;
  return 0;
}
