#include <bits/stdc++.h>
using namespace std;
string inp;
long long mod = 1000000007;
long long pow2[200];
void prep() {
  pow2[0] = 1;
  for (int i = 1; i < 200; ++i) {
    pow2[i] = pow2[i - 1] * 2ll;
    pow2[i] %= mod;
  }
}
long long ans(int len) {
  if (len == -1) {
    return 0;
  }
  if (inp[len] == '0') {
    int cn = 0;
    while (inp[len - cn] == '0' && len - cn >= 0) {
      ++cn;
    }
    return ((pow2[cn] * ans(len - cn)) % mod);
  } else {
    return ((((pow2[len] * pow2[len]) % mod) + (2ll * ans(len - 1) % mod)) %
            mod);
  }
}
int main() {
  prep();
  ios_base::sync_with_stdio(false);
  cin >> inp;
  reverse(inp.begin(), inp.end());
  int len = inp.length();
  cout << ans(len - 1) << endl;
  return 0;
}
