#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 10;
const int MOD = 1e9 + 7;
string x;
map<string, long long> dp;
long long pow(long long a, long long n) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % MOD;
    a = a * a % MOD;
    n >>= 1;
  }
  return res;
}
int main() {
  long long res;
  while (cin >> x) {
    int n = x.size();
    dp.clear();
    if (x[n - 1] == '1')
      res = 1;
    else
      res = 0;
    for (int i = n - 2; i >= 0; i--) {
      if (x[i] == '1')
        res = (2LL * res % MOD +
               pow(2LL, (long long)2 * (long long)(n - i - 1))) %
              MOD;
      else
        res = 2LL * res % MOD;
    }
    printf("%I64d\n", res);
  }
  return 0;
}
