#include <bits/stdc++.h>
using namespace std;
inline int in() {
  int x;
  scanf("%d", &x);
  return x;
}
const int N = 1e2 + 10;
const int MOD = 1e9 + 7;
const long double eps = 1e-12;
string s;
int n;
long long ans, p[N];
int main() {
  p[0] = 1;
  for (int i = 1; i < N; i++) p[i] = (p[i - 1] * 2) % MOD;
  cin >> s;
  n = s.length();
  for (int i = 0; i < n; i++) {
    if (s[i] == '0') continue;
    long long y = p[n - i - 1] * p[n - i - 1];
    y %= MOD;
    ans = ans + ((p[i] * y) % MOD);
    ans %= MOD;
  }
  cout << ans;
  return 0;
}
