#include <bits/stdc++.h>
using namespace std;
const int M = 1000000007;
string x;
long long pow(int k) {
  if (k == 0) return 1;
  long long res = pow(k / 2);
  res = (res * res) % M;
  if (k & 1) res = (res * 2) % M;
  return res;
}
void solve() {
  int n = x.size();
  long long ans = 0;
  for (int i = 0; i < (n); ++i)
    if (x[i] == '1') ans = (ans + pow(2 * n - (i + 1) - 1)) % M;
  cout << ans << endl;
}
int main() {
  cin >> x;
  solve();
  return 0;
}
