#include <bits/stdc++.h>
using namespace std;
long long in() {
  int32_t x;
  scanf("%d", &x);
  return x;
}
inline long long lin() {
  long long x;
  scanf("%lld", &x);
  return x;
}
inline void read(long long *a, long long n) {
  for (long long i = 0; i < n; i++) a[i] = in();
}
inline void readL(long long *a, long long n) {
  for (long long i = 0; i < n; i++) a[i] = lin();
}
const long long maxn = 1e6 + 10;
const long long mod = 1e9 + 7;
const long long MAX_VAL = 1e18 + 10;
inline long long power(long long a, long long b) {
  return b == 0 ? 1 : power(a * a % mod, b >> 1) * (b % 2 ? a : 1) % mod;
}
int32_t main() {
  string s;
  cin >> s;
  long long n = (long long)s.size();
  long long res = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '0') continue;
    (res += power(2, i) * power(4, (n - i - 1))) %= mod;
  }
  cout << res << endl;
}
