#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long total = 0, pows[101] = {1};
  for (int x = 1; x < 101; x++)
    pows[x] = pows[x - 1] * 2LL, pows[x] %= ((long long)1e9 + 7);
  int j = 0, sz = s.size();
  for (int x = sz - 1; x >= 0; x--)
    total += s[x] == '1' ? pows[j] * pows[sz - 1] : 0,
        total %= ((long long)1e9 + 7), j++;
  cout << total << '\n';
}
