#include <bits/stdc++.h>
using namespace std;
const long long modulo = 1e9 + 7;
long long pw2[128];
void init() {
  pw2[0] = 1;
  for (int i = 1; i < 128; ++i) pw2[i] = (pw2[i - 1] * 2) % modulo;
}
int main() {
  init();
  string s;
  cin >> s;
  long long res = 0;
  reverse(s.begin(), s.end());
  for (int i = 0; i < s.size(); ++i)
    if (s[i] == '1') {
      res = res + ((pw2[i] * pw2[i]) % modulo) * pw2[(int)s.size() - 1 - i];
      res = res % modulo;
    }
  cout << res << endl;
}
