#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long bigmod(long long b, long long p, long long m) {
  long long r = 1;
  while (p > 0) {
    if (p % 2 == 1) {
      r = (r * b) % m;
    }
    p /= 2;
    b = (b * b) % m;
  }
  return r;
}
long long n, t1, t2, t3;
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> s;
  n = ((int)(s.size()));
  t1 = bigmod(2, n - 1, mod);
  reverse(s.begin(), s.end());
  for (int i(0), _n(((int)(s.size()))); i < _n; ++i) {
    if (s[i] == '1') {
      t2 += t1;
      t2 %= mod;
    }
    t1 *= 2;
    t1 %= mod;
  }
  cout << t2 << endl;
}
